geometry
AreCollinear
test if three points are collinear
Calling Sequence
Parameters
Description
Examples
AreCollinear(P, Q, R, cond)
P, Q, R
-
three points
cond
(optional) name
Points P, Q, R are said to be collinear if they lie on the same straight line.
The routine returns true if P, Q, and R are collinear; false if they are not; and FAIL if it is unable to determine if the three points are collinear.
If FAIL is returned, and the optional argument cond is given, the condition that makes the points collinear is assigned to this argument.
The command with(geometry,AreCollinear) allows the use of the abbreviated form of this command.
with⁡geometry:
point⁡A,0,0,point⁡B,2,0,point⁡C,−3,0,point⁡F,2,3:
point⁡M,mx,my:
AreCollinear⁡A,B,C
true
AreCollinear⁡A,C,F
false
AreCollinear⁡A,F,M,cond
AreCollinear: "hint: could not determine if 2*my-3*mx is zero"
FAIL
2⁢my−3⁢mx=0
make necessary assumption so that A, F, M are collinear
assume⁡cond
AreCollinear⁡A,F,M
See Also
geometry[AreConcurrent]
geometry[IsOnCircle]
geometry[IsOnLine]
geometry[point]
Download Help Document