| Copyright | (C) Frank Staals |
|---|---|
| License | see the LICENSE file |
| Maintainer | Frank Staals |
| Safe Haskell | None |
| Language | GHC2024 |
HGeometry.Polygon.Convex.Unbounded
Description
A type for representing unbounded, Convex, polygonal regions.
Synopsis
- type UnboundedConvexRegion vertex = UnboundedConvexRegionF (NumType vertex) NonEmpty vertex
- data UnboundedConvexRegionF r (nonEmpty :: Type -> Type) vertex = Unbounded (Vector 2 r) (nonEmpty vertex) (Vector 2 r)
- chain :: forall r nonEmpty vertex nonEmpty' vertex' f. Functor f => (nonEmpty vertex -> f (nonEmpty' vertex')) -> UnboundedConvexRegionF r nonEmpty vertex -> f (UnboundedConvexRegionF r nonEmpty' vertex')
- extremalVertices :: UnboundedConvexRegionF r NonEmpty vertex -> Either vertex (Vector 2 vertex)
- mapChain :: (nonEmpty vertex -> nonEmpty' vertex') -> UnboundedConvexRegionF r nonEmpty vertex -> UnboundedConvexRegionF r nonEmpty' vertex'
- boundedCore :: forall (nonEmpty :: Type -> Type) vertex r. (VertexContainer nonEmpty vertex, Point_ vertex 2 r, HasFromFoldable1 nonEmpty) => UnboundedConvexRegionF r nonEmpty vertex -> PossiblyDegenerateSimplePolygon vertex (ConvexPolygonF (Cyclic nonEmpty) vertex)
- boundingRays :: (Point_ vertex 2 r, Num r) => UnboundedConvexRegionF r NonEmpty vertex -> Vector 2 (HalfLine vertex)
- unboundedBoundingHalfplanes :: (Point_ vertex 2 r, Num r, Ord r) => UnboundedConvexRegionF r NonEmpty vertex -> TwoOrThree (HalfPlaneF (LinePV 2 r))
- toBoundedFrom :: (Foldable nonEmpty, Point_ point 2 r, Point_ vertex 2 r, Ord r, Fractional r) => nonEmpty point -> UnboundedConvexRegionF r NonEmpty vertex -> ConvexPolygonF (Cyclic NonEmpty) vertex
- data LineUnboundedConvexRegionIntersection r
Documentation
type UnboundedConvexRegion vertex = UnboundedConvexRegionF (NumType vertex) NonEmpty vertex Source #
An unbounded polygonal Convex Region
data UnboundedConvexRegionF r (nonEmpty :: Type -> Type) vertex Source #
An unbounded polygonal ConvexRegion whose vertices are stored in an nonEmpty
Constructors
| Unbounded | |
Fields
| |
Instances
chain :: forall r nonEmpty vertex nonEmpty' vertex' f. Functor f => (nonEmpty vertex -> f (nonEmpty' vertex')) -> UnboundedConvexRegionF r nonEmpty vertex -> f (UnboundedConvexRegionF r nonEmpty' vertex') Source #
Lens to access the chain of vertices in CCW order
extremalVertices :: UnboundedConvexRegionF r NonEmpty vertex -> Either vertex (Vector 2 vertex) Source #
Compute the first and last vertex of the chain. Returns a Left if the first and last are the same.
mapChain :: (nonEmpty vertex -> nonEmpty' vertex') -> UnboundedConvexRegionF r nonEmpty vertex -> UnboundedConvexRegionF r nonEmpty' vertex' Source #
map a function over the sequence of points
boundedCore :: forall (nonEmpty :: Type -> Type) vertex r. (VertexContainer nonEmpty vertex, Point_ vertex 2 r, HasFromFoldable1 nonEmpty) => UnboundedConvexRegionF r nonEmpty vertex -> PossiblyDegenerateSimplePolygon vertex (ConvexPolygonF (Cyclic nonEmpty) vertex) Source #
Computes the core of the unbounded region; i.e. the convex hull of the vertices of the region.
boundingRays :: (Point_ vertex 2 r, Num r) => UnboundedConvexRegionF r NonEmpty vertex -> Vector 2 (HalfLine vertex) Source #
Computes the two bounding rays of the unbounded region. Note that the rays now are both pointing toward infinity. The second ray has the unbounded region to its left, whereas the first one has it to its right.
unboundedBoundingHalfplanes :: (Point_ vertex 2 r, Num r, Ord r) => UnboundedConvexRegionF r NonEmpty vertex -> TwoOrThree (HalfPlaneF (LinePV 2 r)) Source #
the 2 or three halfplanes bounding the unbounded part of the region in particular: the region minus its bounded core
toBoundedFrom :: (Foldable nonEmpty, Point_ point 2 r, Point_ vertex 2 r, Ord r, Fractional r) => nonEmpty point -> UnboundedConvexRegionF r NonEmpty vertex -> ConvexPolygonF (Cyclic NonEmpty) vertex Source #
Given some convex shape S, construct some "big enough" convex polygon B out of the unbounded convex polygon U so that the intersection \(U \cap S\) is the same as (B cap S)
note: this creates some new vertices; which are "copies" from the extremal vertices.
this is to avoid having to introduce yet another level of OriginalOrExtra's
data LineUnboundedConvexRegionIntersection r Source #
Intersection between a halfline and a unbounded convex region
Constructors
| Line_x_UnboundedConvexRegion_HalfLine (HalfLine (Point 2 r)) | |
| Line_x_UnboundedConvexRegion_LineSegment (ClosedLineSegment (Point 2 r)) | |
| Line_x_UnboundedConvexRegion_Point (Point 2 r) |
Instances
| Show r => Show (LineUnboundedConvexRegionIntersection r) Source # | |
Defined in HGeometry.Polygon.Convex.Unbounded | |
| Eq r => Eq (LineUnboundedConvexRegionIntersection r) Source # | |
Defined in HGeometry.Polygon.Convex.Unbounded | |
| (Ord r, Num r) => HasIntersectionWith (Point 2 r) (LineUnboundedConvexRegionIntersection r) Source # | |
Defined in HGeometry.Polygon.Convex.Unbounded Methods intersects :: Point 2 r -> LineUnboundedConvexRegionIntersection r -> Bool Source # | |