Graphics Reference
In-Depth Information
3.1.6.3 INCIRCLE2D(
A
,
B
,
C
,
D
)
Given four 2D points
A
=
(
a
x
,
a
y
),
B
=
(
b
x
,
b
y
),
C
=
(
c
x
,
c
y
), and
D
=
(
d
x
,
d
y
), define
INCIRCLE2D(
A
,
B
,
C
,
D
)as
a
x
+
a
y
a
x
a
y
1
b
x
+
b
y
b
x
b
y
1
INCIRCLE2D(
A
,
B
,
C
,
D
)
=
c
x
+
c
y
c
x
c
y
1
d
x
+
d
y
d
x
d
y
1
d
x
)
2
d
y
)
2
a
x
−
d
x
a
y
−
d
y
(
a
x
−
+
(
a
y
−
d
x
)
2
d
y
)
2
=
b
x
−
d
x
b
y
−
d
y
(
b
x
−
+
(
b
y
−
.
d
x
)
2
d
y
)
2
c
x
−
d
x
c
y
−
d
y
(
c
x
−
+
(
c
y
−
Let
the
triangle
ABC
appear
in
counterclockwise
order,
as
indicated
by
>
>
ORIENT2D(
A
,
B
,
C
)
0,
D
lies inside the
circle through the three points
A
,
B
, and
C
. If instead INCIRCLE2D(
A
,
B
,
C
,
D
)
0. Then, when INCIRCLE2D(
A
,
B
,
C
,
D
)
<
0,
D
lies outside the circle. When INCIRCLE2D(
A
,
B
,
C
,
D
)
=
0, the four points are
cocircular. If ORIENT2D(
A
,
B
,
C
)
<
0, the result is reversed.
3.1.6.4 INSPHERE(
A
,
B
,
C
,
D
,
E
)
Given five 3D points
A
=
(
a
x
,
a
y
,
a
z
),
B
=
(
b
x
,
b
y
,
b
z
),
C
=
(
c
x
,
c
y
,
c
z
),
D
=
(
d
x
,
d
y
,
d
z
),
and
E
=
(
e
x
,
e
y
,
e
z
), define INSPHERE(
A
,
B
,
C
,
D
,
E
)as
a
x
+
a
y
+
a
z
a
x
a
y
a
z
1
b
x
+
b
y
+
b
z
b
x
b
y
b
z
1
c
x
+
c
y
+
c
z
INSPHERE(
A
,
B
,
C
,
D
,
E
)
=
c
x
c
y
c
z
1
d
x
+
d
y
+
d
z
d
x
d
y
d
z
1
e
x
+
e
y
+
e
z
e
x
e
y
e
z
1
e
x
)
2
e
y
)
2
e
z
)
2
a
x
−
e
x
a
y
−
e
y
a
z
−
e
z
(
a
x
−
+
(
a
y
−
+
(
a
z
−
e
x
)
2
e
y
)
2
e
z
)
2
b
x
−
e
x
b
y
−
e
y
b
z
−
e
z
(
b
x
−
+
(
b
y
−
+
(
b
z
−
=
.
e
x
)
2
e
y
)
2
e
z
)
2
c
x
−
e
x
c
y
−
e
y
c
z
−
e
z
(
c
x
−
+
(
c
y
−
+
(
c
z
−
e
x
)
2
e
y
)
2
e
z
)
2
d
x
−
e
x
d
y
−
e
y
d
z
−
e
z
(
d
x
−
+
(
d
y
−
+
(
d
z
−
Let the four points
A
,
B
,
C
, and
D
be oriented such that ORIENT3D(
A
,
B
,
C
,
D
)
>
0.
Then, when INSPHERE(
A
,
B
,
C
,
D
,
E
)
0,
E
lies inside the sphere through
A
,
B
,
C
, and
D
. If instead INSPHERE(
A
,
B
,
C
,
D
,
E
)
>
<
0,
E
lies outside the sphere. When
=
INSPHERE(
A
,
B
,
C
,
D
,
E
)
0, the five points are cospherical.