Home

collinear

Collinear describes a set of points that lie on a single straight line. By definition, any two points are collinear, and a set of three or more points is collinear if and only if there exists a straight line containing all of them.

In the plane, given points A(x1,y1), B(x2,y2), and C(x3,y3), they are collinear if the area of triangle

In three-dimensional space, three points A, B, and C are collinear if AB and AC are parallel,

Collinearity has several applications in geometry and computational geometry. It is used to detect degenerate configurations,

ABC
is
zero,
which
is
equivalent
to
a
zero
determinant.
A
practical
condition
is
(x2
-
x1)(y3
-
y1)
-
(y2
-
y1)(x3
-
x1)
=
0.
Another
common
test
is
that
the
slopes
of
AB
and
AC
are
equal
(with
a
caveat
for
vertical
lines,
where
x1
=
x2
=
x3).
In
vector
form,
AB
and
AC
are
linearly
dependent,
meaning
there
exists
a
scalar
t
such
that
AB
=
t·AC.
which
can
be
checked
by
a
zero
cross
product
AB
×
AC.
More
generally,
points
lie
on
the
same
line
if
they
can
be
written
in
a
parametric
form
r
=
p0
+
t
v,
where
p0
is
a
point
on
the
line
and
v
is
a
direction
vector.
simplify
problems,
and
influence
algorithms
for
convex
hulls,
polygon
validity,
and
coordinate
geometry.
Testing
collinearity
often
involves
determinants
or
cross
products
to
avoid
division
and
maintain
precision,
especially
in
exact
arithmetic
or
when
dealing
with
floating-point
coordinates.
See
also
alignment
and
linear
dependence.