API
The pseudo type :: 2 indicate Tuple{Float64,Float64} or any type T such that ExactPredicates.coord(::T) or Base.Tuple(::T) outputs a Tuple{Float64,Float64}. Similaly, :: 3 indicates Tuple{Float64,Float64,Float64} or any type convertible to it coord or Tuple.
Planar predicates
ExactPredicates.closest — Methodclosest(p :: 2, q :: 2, a :: 2) -> Int- Return 1 if
ais closer topthan toq. - Return –1 if
ais closer toqthan top. - Return 0 is
ais equaly close to both.
ExactPredicates.incircle — Methodincircle(a :: 2, b :: 2, c :: 2, p :: 2) -> IntAssume that a, b and c define a counterclockwise triangle.
- Return 1 if
pis strictly inside the circumcircle of this triangle. - Return –1 if
pis outside. - Return 0 if
pis on the circle.
If the triangle is oriented clockwise, the signs are reversed. If a, b and c are collinear, this degenerate to an orientation test.
If two of the four arguments are equal, return 0.
ExactPredicates.intersectorder — Methodintersectorder(a :: 2, b :: 2, pa :: 2, pb :: 2, qa :: 2, qb :: 2) -> IntConsider the oriented line L defined by a and b, the line P defined by pa and pb and the line Q defined by qa and qb.
Assumes that parallelorder(a, b, pa, pb) and parallelorder(a, b, qa, qb) have the same sign. Otherwise, the result has the opposite sign.
- return -1 if the intersection of P with L comes before the intersection of Q with L, following the orientation of L.
- return 1 in the reverse situation
- return 0 in case of equality or degeneracy.
ExactPredicates.meet — Methodmeet(p :: 2, q :: 2, a :: 2, b :: 2)- Return 1 if the open line segments
(p, q)and(a, b)meet in a single point. - Return 0 if the the closed line segments
[p, a]and[a, b]meet in one or several points. - Return –1 otherwise.
ExactPredicates.orient — Methodorient(p :: 2, q :: 2, r :: 2) -> Int- Return 1 if
ris on the left of the oriented line defined bypandq. - Return –1 if
ris on the right. - Return 0 if
ris on the line or ifp == q.
ExactPredicates.parallelorder — Methodparallelorder(a :: 2, b :: 2, p :: 2, q :: 2) -> IntConsider the oriented line defined by a and b and the parallel lines passing through p and q respectively, with the same orientation.
- return 1 if the line passing through
pis left of the line passing throughq. - return -1 in the reverse situation.
- return 0 if
aandbare equal or if the parallel lines passing throughpandqare equal.
This is a robust version of to orient(b-a, q-p, 0). Note also that orient(a, b, c) == parallelorder(a, b, a, c).
ExactPredicates.rotation — Methodrotation(pts :: AbstractVector)Gives the number of rotation of the polygonal path defined by the elements of pts.
ExactPredicates.sameside — Methodsameside(p :: 2, a :: 2, b :: 2)Assume that the three arguments are collinear, on some line L
- Return 1 if
aandbare on the same side ofpon L - Return -1 if
aandbare on different sides - Return 0 if
a == porb == p.
Spatial predicates
ExactPredicates.closest — Methodclosest(p :: 3, q :: 3, a :: 3) -> IntReturn 1 if a is closer to p than to q. Return –1 if a is closer to q than to p. Return 0 is a is equaly close to both.
ExactPredicates.insphere — Methodinsphere(p :: 3, q :: 3, r :: 3, s :: 3, a :: 3)- Return 1 if
ais inside the circumscribed sphere defined by the four pointsp,q,rands. - Return –1 if
ais outside. - Return 0 is
alies on the sphere or if the four points are coplanar.
ExactPredicates.orient — Methodorient(p :: 3, q :: 3, r :: 3, a :: 3) -> IntConsider the oriented plane on which the triangle pqr is positively oriented.
- Return 1 if
ais below this plane. - Return –1 if
ais above this plane. - Return 0 if
alies on this plane.