This can be used to determine when an object crosses a line perpendicular to p1p2, for example along a line from threat to safety

orthdist(p1, p2, p3)

Arguments

p1

A vector of arbitrary dimension

p2

Another vector with he same dimensions as p1

p3

Yet another vector with the same dimensions

Value

A scalar