Zoning/streaming refactor
This commit is contained in:
+7
-7
@@ -84,19 +84,19 @@ circOnSegNoEndpoints !p1 !p2 !c !rad = intersectSegSegTest p1 p2 (c -.- thenorma
|
||||
-- | Test whether a circle is on a segment by intersecting a normal and testing
|
||||
-- the distance to the endpoints of the segment.
|
||||
-- Perhaps a better order of arguments.
|
||||
circOnSeg' :: Point2 -> Float -> Point2 -> Point2 -> Bool
|
||||
{-# INLINE circOnSeg' #-}
|
||||
circOnSeg' !c !rad !p1 !p2 = magV (p1 -.- c) <= rad
|
||||
circOnSeg :: Point2 -> Float -> Point2 -> Point2 -> Bool
|
||||
{-# INLINE circOnSeg #-}
|
||||
circOnSeg !c !rad !p1 !p2 = magV (p1 -.- c) <= rad
|
||||
|| magV (p2 -.- c) <= rad
|
||||
|| intersectSegSegTest p1 p2 (c -.- thenormal) (c +.+ thenormal)
|
||||
where
|
||||
thenormal = rad *.* vNormal (normalizeV $ p1 -.- p2)
|
||||
|
||||
-- | Test whether a circle is on a segment by intersecting a normal and testing
|
||||
-- | Test whether a segment intersects a circle by intersecting a normal and testing
|
||||
-- the distance to the endpoints of the segment.
|
||||
circOnSeg :: Point2 -> Point2 -> Point2 -> Float -> Bool
|
||||
{-# INLINE circOnSeg #-}
|
||||
circOnSeg !p1 !p2 !c !rad = magV (p1 -.- c) <= rad
|
||||
segOnCirc :: Point2 -> Point2 -> Point2 -> Float -> Bool
|
||||
{-# INLINE segOnCirc #-}
|
||||
segOnCirc !p1 !p2 !c !rad = magV (p1 -.- c) <= rad
|
||||
|| magV (p2 -.- c) <= rad
|
||||
|| intersectSegSegTest p1 p2 (c -.- thenormal) (c +.+ thenormal)
|
||||
where
|
||||
|
||||
Reference in New Issue
Block a user