CollinearPoints[{p1,p2,p3,…,pn}]
tests whether the points p1,p2,p3,…,pn are collinear.
CollinearPoints
CollinearPoints[{p1,p2,p3,…,pn}]
tests whether the points p1,p2,p3,…,pn are collinear.
Details
- CollinearPoints is also known as rectilinear.
- Typically used to test whether a set of points lie on the same straight line.
- CollinearPoints[{p1,p2,p3,…,pn}] gives True if the points p3,…,pn are on the line passing through p1 and p2.
- For collinear points p1, p2 and p3, the rank of the matrix {p2-p1,p3-p1} is less than or equal to 1.
Examples
open all close allBasic Examples (2)
The points {0,0},{1,2},{2,4} are collinear:
pts = {{0, 0}, {1, 2}, {2, 4}};CollinearPoints[pts]Graphics[{Line[pts], Red, Point[pts]}]Find the equation of the line passing through the points {0,1} and {1,2}:
CollinearPoints[{{0, 1}, {1, 2}, {x, y}}]Scope (4)
CollinearPoints works with two-dimensional points:
CollinearPoints[{{1, 1}, {3, 4}, {5, 6}}]CollinearPoints[{{1, 2, 1}, {3, 4, 1}, {5, 6, 1}, {7, 8, 1}}]CollinearPoints[{{0, 0, 1, 1}, {1, 0, 1, 0}, {0, 1, 0, 1}, {0, 1, 1, 1}, {0, 0, 0, 1}}]CollinearPoints works with numerical coordinates:
CollinearPoints[{{1, 1}, {3, 4}, {5, 6}}]CollinearPoints[{{0, 0, 1}, {1, 0, 1}, {0, 1, 1}, {a, b, c}}]CollinearPoints over a set of coordinates:
CollinearPoints[{{1, 2, 1}, {3, 4, 1}, {5, 6, 1}, {7, 8, 1}}]CollinearPoints[{Point[{0, 0, 1}], Point[{1, 0, 1}], Point[{0, 1, 1}], Point[{a, b, c}]}]CollinearPoints[Point[{{0, 0, 1}, {1, 0, 1}, {1, 3, 1}, {a, b, c}}]]CollinearPoints works for large sets:
pts = RandomPoint[Line[{{0, 0}, {1, 0}}], 10 ^ 6];CollinearPoints[pts]//AbsoluteTimingApplications (4)
Basic Applications (3)
Find conditions for which two points lie on a line passing through the origin:
CollinearPoints[{{0, 0}, {a, b}, {c, d}}]{{a, b}, {c, d}} /. FindInstance[% && a ≠ 0, {a, b, c, d}, Reals, 3]Find the equation of the line passing through the points {0,1} and {1,2}:
CollinearPoints[{{0, 1}, {1, 2}, {x, y}}]pts = {{0, 0}, {1, 1}, {2, 2}};CollinearPoints[pts]Graphics[{InfiniteLine[pts[[1 ;; 2]]], Red, Point[pts]}]Geometry (1)
Noncollinear points form a polygon:
pts = {{0, 0}, {1, 3}, {2, 2}};CollinearPoints[pts]Graphics[Polygon[pts]]pts = {{0, 0}, {1, 1}, {2, 2}};CollinearPoints[pts]Graphics[{EdgeForm[StandardGray], Polygon[pts]}]Properties & Relations (5)
PositivelyOrientedPoints returns False for collinear points:
pts = {{0, 0}, {1, 2}, {2, 4}};{CollinearPoints[pts], PositivelyOrientedPoints[pts]}NegativelyOrientedPoints returns False for collinear points:
pts = {{0, 0}, {1, 2}, {2, 4}};{CollinearPoints[pts], NegativelyOrientedPoints[pts]}Collinear points are coplanar:
pts = RandomPoint[Line[{{0, 0, 0}, {1, 1, 1}}], 5];{CollinearPoints[pts], CoplanarPoints[pts]}Use RegionMember to test whether points are collinear:
RegionMember[Line[{{0, 0}, {1, 1}}], {2, 2}]CollinearPoints[{{0, 0}, {1, 1}, {2, 2}}]Use InfiniteLine to draw a graphics image:
pts = {{0, 0}, {1, 1}, {2, 2}};Graphics[{InfiniteLine[pts[[1 ;; 2]]], Red, Point[pts]}]Related Guides
History
Text
Wolfram Research (2020), CollinearPoints, Wolfram Language function, https://reference.wolfram.com/language/ref/CollinearPoints.html.
CMS
Wolfram Language. 2020. "CollinearPoints." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CollinearPoints.html.
APA
Wolfram Language. (2020). CollinearPoints. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CollinearPoints.html
BibTeX
@misc{reference.wolfram_2026_collinearpoints, author="Wolfram Research", title="{CollinearPoints}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/CollinearPoints.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_collinearpoints, organization={Wolfram Research}, title={CollinearPoints}, year={2020}, url={https://reference.wolfram.com/language/ref/CollinearPoints.html}, note=[Accessed: 13-June-2026]}