Copyright | (C) Frank Staals |
---|---|
License | see the LICENSE file |
Maintainer | Frank Staals |
Safe Haskell | None |
Language | Haskell2010 |
\(d\)-dimensional HalfSpaces
Synopsis
- newtype HalfSpace d r = HalfSpace {
- _boundingPlane :: HyperPlane d r
- boundingPlane :: forall d r d r. Iso (HalfSpace d r) (HalfSpace d r) (HyperPlane d r) (HyperPlane d r)
- type HalfPlane = HalfSpace 2
- leftOf :: Num r => Line 2 r -> HalfPlane r
- rightOf :: Num r => Line 2 r -> HalfPlane r
- above :: Num r => Line 2 r -> HalfPlane r
- below :: Num r => Line 2 r -> HalfPlane r
- inHalfSpace :: (Num r, Ord r, Arity d) => Point d r -> HalfSpace d r -> PointLocationResult
Documentation
>>>
:{
let myVector :: Vector 3 Int myVector = Vector3 1 2 3 myPoint = Point myVector :}
newtype HalfSpace d r Source #
A Halfspace in \(d\) dimensions. Note that the intended side of the halfspace is already indicated by the normal vector of the bounding plane.
HalfSpace | |
|
Instances
boundingPlane :: forall d r d r. Iso (HalfSpace d r) (HalfSpace d r) (HyperPlane d r) (HyperPlane d r) Source #
leftOf :: Num r => Line 2 r -> HalfPlane r Source #
Get the halfplane left of a line (i.e. "above") a line
>>>
leftOf $ horizontalLine 4
HalfSpace {_boundingPlane = HyperPlane {_inPlane = Point2 0 4, _normalVec = Vector2 0 1}}
rightOf :: Num r => Line 2 r -> HalfPlane r Source #
Get the halfplane right of a line (i.e. "below") a line
>>>
rightOf $ horizontalLine 4
HalfSpace {_boundingPlane = HyperPlane {_inPlane = Point2 0 4, _normalVec = Vector2 0 (-1)}}
inHalfSpace :: (Num r, Ord r, Arity d) => Point d r -> HalfSpace d r -> PointLocationResult Source #
Test if a point lies in a halfspace