| Copyright | (C) Frank Staals |
|---|---|
| License | see the LICENSE file |
| Maintainer | Frank Staals |
| Safe Haskell | None |
| Language | GHC2024 |
HGeometry.Kernel
Description
Constant Complexity Geometric Primitives
Synopsis
- module HGeometry.Point
- module HGeometry.Vector
- module HGeometry.Line
- module HGeometry.HyperPlane
- module HGeometry.HalfSpace
- module HGeometry.LineSegment
- class IsBoxable g where
- class (HasMinPoint box point, HasMaxPoint box point, Point_ point (Dimension box) (NumType box)) => Box_ box point | box -> point where
- data Box point where
- type Rectangle = Box
- module HGeometry.Ball
- data Triangle point where
- module HGeometry.Transformation
- module HGeometry.Intersection
- module HGeometry.Properties
Documentation
module HGeometry.Point
module HGeometry.Vector
module HGeometry.Line
module HGeometry.HyperPlane
module HGeometry.HalfSpace
module HGeometry.LineSegment
class IsBoxable g where Source #
Types for which we can compute an axis parallel boundingbox
Minimal complete definition
Nothing
Methods
boundingBox :: forall (d :: Nat) r. (d ~ Dimension g, r ~ NumType g, Ord r) => g -> Box (Point d r) Source #
Compute the axis-parallel boundingbox of the given geometry.
Instances
| (IsBoxable g, Has_ Additive_ d r, d ~ Dimension g, r ~ NumType g) => IsBoxable (NonEmpty g) Source # | |
| (Box_ (Box point) point, Point_ point d r) => IsBoxable (Box point) Source # | |
| (Point_ point d r, Ord (Vector d r)) => IsBoxable (Triangle point) Source # | |
| IsBoxable g => IsBoxable (g :+ extra) Source # | |
| (Traversable1 endPoint, Point_ point d r, d ~ Dimension point, r ~ NumType point, Ord r, Ord (Vector d r)) => IsBoxable (LineSegment endPoint point) Source # | |
Defined in HGeometry.LineSegment.Internal Methods boundingBox :: forall (d0 :: Nat) r0. (d0 ~ Dimension (LineSegment endPoint point), r0 ~ NumType (LineSegment endPoint point), Ord r0) => LineSegment endPoint point -> Box (Point d0 r0) Source # | |
| IsBoxable (Point d r) Source # | |
class (HasMinPoint box point, HasMaxPoint box point, Point_ point (Dimension box) (NumType box)) => Box_ box point | box -> point where Source #
d-dimensional Boxes
Methods
extent :: forall r (d :: Nat). (r ~ NumType box, d ~ Dimension box, Num r) => box -> Vector d (ClosedInterval r) Source #
Get a vector with the extent of the box in each dimension. Note that the resulting vector is 0 indexed whereas one would normally count dimensions starting at zero.
D-dimensional boxes.
A box is represented by two points; a point with lexicographically minimal coordinates, and a point with lexicographically maximal coordinates.
Bundled Patterns
| pattern Box :: point -> point -> Box point | Construct a box |
| pattern Rect :: Num r => r -> r -> r -> r -> Rectangle (Point 2 r) | Given x y w h construct the rectangle with bottom left corner (x,y), width w, and hegith h. |
| pattern Rectangle :: Dimension point ~ 2 => point -> point -> Box point | Construct a Rectangle |
Instances
module HGeometry.Ball
data Triangle point where Source #
Triangles in d-dimensional space
Bundled Patterns
| pattern Triangle :: point -> point -> point -> Triangle point | Construct a triangle from its three points |
Instances
| Foldable1 Triangle Source # | |||||||||
Defined in HGeometry.Triangle Methods fold1 :: Semigroup m => Triangle m -> m Source # foldMap1 :: Semigroup m => (a -> m) -> Triangle a -> m Source # foldMap1' :: Semigroup m => (a -> m) -> Triangle a -> m Source # toNonEmpty :: Triangle a -> NonEmpty a Source # maximum :: Ord a => Triangle a -> a Source # minimum :: Ord a => Triangle a -> a Source # head :: Triangle a -> a Source # last :: Triangle a -> a Source # foldrMap1 :: (a -> b) -> (a -> b -> b) -> Triangle a -> b Source # foldlMap1' :: (a -> b) -> (b -> a -> b) -> Triangle a -> b Source # foldlMap1 :: (a -> b) -> (b -> a -> b) -> Triangle a -> b Source # foldrMap1' :: (a -> b) -> (a -> b -> b) -> Triangle a -> b Source # | |||||||||
| Functor Triangle Source # | |||||||||
| Foldable Triangle Source # | |||||||||
Defined in HGeometry.Triangle Methods fold :: Monoid m => Triangle m -> m Source # foldMap :: Monoid m => (a -> m) -> Triangle a -> m Source # foldMap' :: Monoid m => (a -> m) -> Triangle a -> m Source # foldr :: (a -> b -> b) -> b -> Triangle a -> b Source # foldr' :: (a -> b -> b) -> b -> Triangle a -> b Source # foldl :: (b -> a -> b) -> b -> Triangle a -> b Source # foldl' :: (b -> a -> b) -> b -> Triangle a -> b Source # foldr1 :: (a -> a -> a) -> Triangle a -> a Source # foldl1 :: (a -> a -> a) -> Triangle a -> a Source # toList :: Triangle a -> [a] Source # null :: Triangle a -> Bool Source # length :: Triangle a -> Int Source # elem :: Eq a => a -> Triangle a -> Bool Source # maximum :: Ord a => Triangle a -> a Source # minimum :: Ord a => Triangle a -> a Source # | |||||||||
| Traversable Triangle Source # | |||||||||
Defined in HGeometry.Triangle | |||||||||
| Traversable1 Triangle Source # | |||||||||
| Generic (Triangle point) Source # | |||||||||
Defined in HGeometry.Triangle Associated Types
| |||||||||
| Read point => Read (Triangle point) Source # | |||||||||
| Show point => Show (Triangle point) Source # | |||||||||
| Eq (Vector 3 point) => Eq (Triangle point) Source # | |||||||||
| Ord (Vector 3 point) => Ord (Triangle point) Source # | |||||||||
Defined in HGeometry.Triangle Methods compare :: Triangle point -> Triangle point -> Ordering Source # (<) :: Triangle point -> Triangle point -> Bool Source # (<=) :: Triangle point -> Triangle point -> Bool Source # (>) :: Triangle point -> Triangle point -> Bool Source # (>=) :: Triangle point -> Triangle point -> Bool Source # max :: Triangle point -> Triangle point -> Triangle point Source # min :: Triangle point -> Triangle point -> Triangle point Source # | |||||||||
| (Point_ point d r, Ord (Vector d r)) => IsBoxable (Triangle point) Source # | |||||||||
| (DefaultTransformByConstraints (Triangle point) d r, Point_ point d r) => IsTransformable (Triangle point) Source # | |||||||||
Defined in HGeometry.Triangle Methods transformBy :: Transformation (Dimension (Triangle point)) (NumType (Triangle point)) -> Triangle point -> Triangle point Source # | |||||||||
| HasEdges' (Triangle point) Source # | |||||||||
Defined in HGeometry.Triangle Associated Types
| |||||||||
| HasVertices' (Triangle point) Source # | |||||||||
Defined in HGeometry.Triangle Associated Types
| |||||||||
| Reversing (Triangle point) Source # | |||||||||
| Point_ vertex 3 r => CanComputeNormalVector (Triangle vertex) r Source # | |||||||||
Defined in HGeometry.Direction Methods normalUnitVectorAt :: forall point (d :: Nat). (Point_ point d r, Has_ Metric_ d r, d ~ Dimension (Triangle vertex), Radical r, Fractional r) => point -> Triangle vertex -> Vector d r Source # normalVectorAt :: forall point (d :: Nat). (Point_ point d r, d ~ Dimension (Triangle vertex), Num r) => point -> Triangle vertex -> Vector d r Source # | |||||||||
| Point_ point (Dimension point) (NumType point) => ConstructableTriangle_ (Triangle point) point Source # | |||||||||
Defined in HGeometry.Triangle Methods mkTriangle :: point -> point -> point -> Triangle point Source # | |||||||||
| Point_ point (Dimension point) (NumType point) => Triangle_ (Triangle point) point Source # | |||||||||
| (Point_ point 3 r, Point_ point' 3 r, Fractional r, Ord r) => HasIntersectionWith (HalfLine point) (Triangle point') Source # | |||||||||
Defined in HGeometry.Triangle | |||||||||
| (Point_ point 2 r, Point_ vertex 2 r, Num r, Ord r) => HasIntersectionWith (ClosedLineSegment point) (Triangle vertex) Source # | Testing for intersections between closed line segments and triangles | ||||||||
Defined in HGeometry.Triangle Methods intersects :: ClosedLineSegment point -> Triangle vertex -> Bool Source # | |||||||||
| (Point_ corner 2 r, Point_ vertex 2 r, Num r, Ord r) => HasIntersectionWith (Triangle corner) (Triangle vertex) Source # | |||||||||
Defined in HGeometry.Triangle | |||||||||
| (Point_ point 3 r, Point_ point' 3 r, Fractional r, Ord r) => IsIntersectableWith (HalfLine point) (Triangle point') Source # | |||||||||
Defined in HGeometry.Triangle | |||||||||
| HasVertices (Triangle point) (Triangle point') Source # | |||||||||
| HasPoints (Triangle point) (Triangle point') point point' Source # | |||||||||
Defined in HGeometry.Triangle | |||||||||
| (Point_ point 3 r, Fractional r, Ord r) => HasIntersectionWith (LinePV 3 r) (Triangle point) Source # | |||||||||
Defined in HGeometry.Triangle | |||||||||
| (Point_ point 2 r, Num r, Ord r) => HasIntersectionWith (Point 2 r) (Triangle point) Source # | |||||||||
Defined in HGeometry.Triangle | |||||||||
| (Point_ point 3 r, Fractional r, Ord r) => IsIntersectableWith (LinePV 3 r) (Triangle point) Source # | |||||||||
Defined in HGeometry.Triangle | |||||||||
| type Rep (Triangle point) Source # | |||||||||
Defined in HGeometry.Triangle | |||||||||
| type Dimension (Triangle point) Source # | |||||||||
Defined in HGeometry.Triangle | |||||||||
| type NumType (Triangle point) Source # | |||||||||
Defined in HGeometry.Triangle | |||||||||
| type Edge (Triangle point) Source # | |||||||||
Defined in HGeometry.Triangle | |||||||||
| type EdgeIx (Triangle point) Source # | |||||||||
Defined in HGeometry.Triangle | |||||||||
| type Vertex (Triangle point) Source # | |||||||||
Defined in HGeometry.Triangle | |||||||||
| type VertexIx (Triangle point) Source # | |||||||||
Defined in HGeometry.Triangle | |||||||||
| type Intersection (HalfLine point) (Triangle point') Source # | Same here, we also return the parameter at which the ray intersects the point | ||||||||
Defined in HGeometry.Triangle type Intersection (HalfLine point) (Triangle point') = Maybe (LineTriangleIntersection (Point 3 (NumType point) :+ NumType point) (ClosedLineSegment (Point 3 (NumType point) :+ NumType point))) | |||||||||
| type Intersection (LinePV 3 r) (Triangle point') Source # | The extra value is the parameter t so that the intersection point is line^.anchor + t*line^.direction | ||||||||
Defined in HGeometry.Triangle type Intersection (LinePV 3 r) (Triangle point') = Maybe (LineTriangleIntersection (Point 3 r :+ r) (ClosedLineSegment (Point 3 r :+ r))) | |||||||||
module HGeometry.Transformation
module HGeometry.Intersection
module HGeometry.Properties