VEC: add intersectSeg''

This commit is contained in:
hasufell 2015-01-08 01:39:39 +01:00
parent 4385ef127b
commit ddb97aa8c7
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020

View File

@ -108,6 +108,14 @@ intersectSeg' (a, b) (c, d) =
glossToPt = p2 . (float2Double *** float2Double) glossToPt = p2 . (float2Double *** float2Double)
-- |Get the point where two lines intesect, if any. Excludes the
-- case of end-points intersecting.
intersectSeg'' :: Segment -> Segment -> Maybe PT
intersectSeg'' (a, b) (c, d) = case intersectSeg' (a, b) (c, d) of
Just x -> if x `notElem` [a,b,c,d] then Just a else Nothing
Nothing -> Nothing
-- |Get the orientation of 3 points which can either be -- |Get the orientation of 3 points which can either be
-- * clock-wise -- * clock-wise
-- * counter-clock-wise -- * counter-clock-wise