If points are collinear it is possible to ask whether they are ordered along the common line. This function is not strict, i.e. it is possible for the middle point to coincide with either the first or last point and still be regarded as ordered between them. This functionality comes in two versions, one that access orderedness between three vectors of points and one that assess it along a single vector. Note that for the later version the return value is 2 elements shorter than the input vector.
in_order(x, y, z) in_order_along(x)
|x, y, z||
Vectors of points
A logical vector
#>  TRUE TRUE FALSE FALSE FALSE FALSE TRUE FALSE FALSE TRUEin_order_along(p)#>  FALSE FALSE TRUE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE #>  FALSE TRUE FALSE TRUE TRUE FALSE TRUE FALSE FALSE TRUE FALSE TRUE #>  FALSE TRUE TRUE TRUE