colinearPoints?()

Synopsis

Returns True if p2 is within tol of the infinite line through p1 and p3. If any of the points are coincident, they are also colinear by definition.

Syntax

colinearPoints? ( p1 As Point, _
                  p2 As Point, _
                  p3 As Point, _
                  Optional tol As Number = 0.001 ) As Boolean 
Argument Type Description
p1 Point First point of infinite line.
p2 Point The point to be tested.
p3 Point Second point of infinite line.
tol Number Optional; tolerance for the deviation; default is 0.001.

Example 1

Intent >colinearPoints?(Point(0,0,0), Point(1,0,0), Point(2,0,0))
--> True

Example 2

Intent >colinearPoints?(Point(0,0,0), Point(1,0,0.125), Point(2,0,0))
--> False

Example 3

Intent >colinearPoints?(Point(0,0,0), Point(1,0,0.125), Point(2,0,0), tol := 0.5)
--> True
Using the same points as Example 2, but specifying a tolerance.