Which side of the line from a to b q is on: > 0 left, < 0 right, 0 on it (twice the signed area of the triangle a, b, q).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | a(2) |
the line's two points, and the point tested |
||
| real(kind=wp), | intent(in) | :: | b(2) |
the line's two points, and the point tested |
||
| real(kind=wp), | intent(in) | :: | q(2) |
the line's two points, and the point tested |
pure real(wp) function side(a, b, q) real(wp), intent(in) :: a(2), b(2), q(2) !! the line's two points, and the point tested side = (b(1) - a(1)) * (q(2) - a(2)) - (q(1) - a(1)) * (b(2) - a(2)) end function side