hgeometry-kernel
Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellNone
LanguageGHC2024

HGeometry.Kernel

Description

Constant Complexity Geometric Primitives

Synopsis

Documentation

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.

default boundingBox :: forall (d :: Nat) r point. (d ~ Dimension g, r ~ NumType g, Ord r, HasPoints' g point, Point_ point d r, Ord (Vector d r)) => g -> Box (Point d r) Source #

Instances

Instances details
(IsBoxable g, Has_ Additive_ d r, d ~ Dimension g, r ~ NumType g) => IsBoxable (NonEmpty g) Source # 
Instance details

Defined in HGeometry.Box.Boxable

Methods

boundingBox :: forall (d0 :: Nat) r0. (d0 ~ Dimension (NonEmpty g), r0 ~ NumType (NonEmpty g), Ord r0) => NonEmpty g -> Box (Point d0 r0) Source #

(Box_ (Box point) point, Point_ point d r) => IsBoxable (Box point) Source # 
Instance details

Defined in HGeometry.Box.Boxable

Methods

boundingBox :: forall (d0 :: Nat) r0. (d0 ~ Dimension (Box point), r0 ~ NumType (Box point), Ord r0) => Box point -> Box (Point d0 r0) Source #

(Point_ point d r, Ord (Vector d r)) => IsBoxable (Triangle point) Source # 
Instance details

Defined in HGeometry.Triangle

Methods

boundingBox :: forall (d0 :: Nat) r0. (d0 ~ Dimension (Triangle point), r0 ~ NumType (Triangle point), Ord r0) => Triangle point -> Box (Point d0 r0) Source #

IsBoxable g => IsBoxable (g :+ extra) Source # 
Instance details

Defined in HGeometry.Box.Boxable

Methods

boundingBox :: forall (d :: Nat) r. (d ~ Dimension (g :+ extra), r ~ NumType (g :+ extra), Ord r) => (g :+ extra) -> Box (Point d r) Source #

(Traversable1 endPoint, Point_ point d r, d ~ Dimension point, r ~ NumType point, Ord r, Ord (Vector d r)) => IsBoxable (LineSegment endPoint point) Source # 
Instance details

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 # 
Instance details

Defined in HGeometry.Box.Boxable

Methods

boundingBox :: forall (d0 :: Nat) r0. (d0 ~ Dimension (Point d r), r0 ~ NumType (Point d r), Ord r0) => Point d r -> Box (Point d0 r0) 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.

Instances

Instances details
(Point_ point d r, Zip (Vector d)) => Box_ (Box point) point Source # 
Instance details

Defined in HGeometry.Box.Internal

Methods

extent :: forall r0 (d0 :: Nat). (r0 ~ NumType (Box point), d0 ~ Dimension (Box point), Num r0) => Box point -> Vector d0 (ClosedInterval r0) Source #

Box_ box point => Box_ (box :+ extra) point Source # 
Instance details

Defined in HGeometry.Box.Class

Methods

extent :: forall r (d :: Nat). (r ~ NumType (box :+ extra), d ~ Dimension (box :+ extra), Num r) => (box :+ extra) -> Vector d (ClosedInterval r) Source #

data Box point where Source #

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

Instances details
Functor Box Source # 
Instance details

Defined in HGeometry.Box.Internal

Methods

fmap :: (a -> b) -> Box a -> Box b Source #

(<$) :: a -> Box b -> Box a Source #

Foldable Box Source # 
Instance details

Defined in HGeometry.Box.Internal

Methods

fold :: Monoid m => Box m -> m Source #

foldMap :: Monoid m => (a -> m) -> Box a -> m Source #

foldMap' :: Monoid m => (a -> m) -> Box a -> m Source #

foldr :: (a -> b -> b) -> b -> Box a -> b Source #

foldr' :: (a -> b -> b) -> b -> Box a -> b Source #

foldl :: (b -> a -> b) -> b -> Box a -> b Source #

foldl' :: (b -> a -> b) -> b -> Box a -> b Source #

foldr1 :: (a -> a -> a) -> Box a -> a Source #

foldl1 :: (a -> a -> a) -> Box a -> a Source #

toList :: Box a -> [a] Source #

null :: Box a -> Bool Source #

length :: Box a -> Int Source #

elem :: Eq a => a -> Box a -> Bool Source #

maximum :: Ord a => Box a -> a Source #

minimum :: Ord a => Box a -> a Source #

sum :: Num a => Box a -> a Source #

product :: Num a => Box a -> a Source #

Traversable Box Source # 
Instance details

Defined in HGeometry.Box.Internal

Methods

traverse :: Applicative f => (a -> f b) -> Box a -> f (Box b) Source #

sequenceA :: Applicative f => Box (f a) -> f (Box a) Source #

mapM :: Monad m => (a -> m b) -> Box a -> m (Box b) Source #

sequence :: Monad m => Box (m a) -> m (Box a) Source #

Generic (Box point) Source # 
Instance details

Defined in HGeometry.Box.Internal

Associated Types

type Rep (Box point) 
Instance details

Defined in HGeometry.Box.Internal

type Rep (Box point) = D1 ('MetaData "Box" "HGeometry.Box.Internal" "hgeometry-kernel-1.0.0.0-inplace" 'True) (C1 ('MetaCons "MkBox" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Vector 2 point))))

Methods

from :: Box point -> Rep (Box point) x Source #

to :: Rep (Box point) x -> Box point Source #

Read point => Read (Box point) Source # 
Instance details

Defined in HGeometry.Box.Internal

Methods

readsPrec :: Int -> ReadS (Box point) Source #

readList :: ReadS [Box point] Source #

readPrec :: ReadPrec (Box point) Source #

readListPrec :: ReadPrec [Box point] Source #

Show point => Show (Box point) Source # 
Instance details

Defined in HGeometry.Box.Internal

Methods

showsPrec :: Int -> Box point -> ShowS Source #

show :: Box point -> String Source #

showList :: [Box point] -> ShowS Source #

Eq point => Eq (Box point) Source # 
Instance details

Defined in HGeometry.Box.Internal

Methods

(==) :: Box point -> Box point -> Bool Source #

(/=) :: Box point -> Box point -> Bool Source #

Ord point => Ord (Box point) Source # 
Instance details

Defined in HGeometry.Box.Internal

Methods

compare :: Box point -> Box point -> Ordering Source #

(<) :: Box point -> Box point -> Bool Source #

(<=) :: Box point -> Box point -> Bool Source #

(>) :: Box point -> Box point -> Bool Source #

(>=) :: Box point -> Box point -> Bool Source #

max :: Box point -> Box point -> Box point Source #

min :: Box point -> Box point -> Box point Source #

(Box_ (Box point) point, Point_ point d r) => IsBoxable (Box point) Source # 
Instance details

Defined in HGeometry.Box.Boxable

Methods

boundingBox :: forall (d0 :: Nat) r0. (d0 ~ Dimension (Box point), r0 ~ NumType (Box point), Ord r0) => Box point -> Box (Point d0 r0) Source #

(Point_ point d r, IsTransformable point) => IsTransformable (Box point) Source # 
Instance details

Defined in HGeometry.Box

Methods

transformBy :: Transformation (Dimension (Box point)) (NumType (Box point)) -> Box point -> Box point Source #

(Point_ point d r, Zip (Vector d)) => Box_ (Box point) point Source # 
Instance details

Defined in HGeometry.Box.Internal

Methods

extent :: forall r0 (d0 :: Nat). (r0 ~ NumType (Box point), d0 ~ Dimension (Box point), Num r0) => Box point -> Vector d0 (ClosedInterval r0) Source #

HasMaxPoint (Box point) point Source # 
Instance details

Defined in HGeometry.Box.Internal

Methods

maxPoint :: Lens' (Box point) point Source #

HasMinPoint (Box point) point Source # 
Instance details

Defined in HGeometry.Box.Internal

Methods

minPoint :: Lens' (Box point) point Source #

(Ord r, Num r, Point_ point d r, HasComponents (Vector d (Interval_x_IntervalIntersection r (ClosedInterval r))) (Vector d (ClosedInterval r)), HasComponents (Vector d (ClosedInterval r)) (Vector d r), Has_ Vector_ d (ClosedInterval r), Has_ Additive_ d r, Traversable (Vector d), Applicative (Vector d), Zip (Vector d)) => HasIntersectionWith (Box point) (Box point) Source # 
Instance details

Defined in HGeometry.Box.Intersection

Methods

intersects :: Box point -> Box point -> Bool Source #

(Point_ point 2 r, Ord r, Num r) => HasIntersectionWith (HalfLine point) (Rectangle point) Source # 
Instance details

Defined in HGeometry.Box

Methods

intersects :: HalfLine point -> Rectangle point -> Bool Source #

(Num r, Ord r, Point_ point 2 r) => HasIntersectionWith (VerticalOrLineEQ r) (Rectangle point) Source # 
Instance details

Defined in HGeometry.Box

(Num r, Ord r, Point_ point 2 r) => HasIntersectionWith (LineEQ r) (Rectangle point) Source # 
Instance details

Defined in HGeometry.Box

Methods

intersects :: LineEQ r -> Rectangle point -> Bool Source #

(Point_ point d r, Ord r, Num r, HasComponents (Vector d (Interval_x_IntervalIntersection r (ClosedInterval r))) (Vector d (ClosedInterval r)), HasComponents (Vector d (ClosedInterval r)) (Vector d r), Has_ Vector_ d (ClosedInterval r), Has_ Additive_ d r, Traversable (Vector d), Applicative (Vector d), Zip (Vector d)) => IsIntersectableWith (Box point) (Box point) Source # 
Instance details

Defined in HGeometry.Box.Intersection

Methods

intersect :: Box point -> Box point -> Intersection (Box point) (Box point) Source #

(Point_ point 2 r, Ord r, Fractional r) => IsIntersectableWith (HalfLine point) (Rectangle point) Source # 
Instance details

Defined in HGeometry.Box

Methods

intersect :: HalfLine point -> Rectangle point -> Intersection (HalfLine point) (Rectangle point) Source #

(Fractional r, Ord r, Point_ point 2 r) => IsIntersectableWith (VerticalOrLineEQ r) (Rectangle point) Source # 
Instance details

Defined in HGeometry.Box

(Fractional r, Ord r, Point_ point 2 r) => IsIntersectableWith (LineEQ r) (Rectangle point) Source # 
Instance details

Defined in HGeometry.Box

Methods

intersect :: LineEQ r -> Rectangle point -> Intersection (LineEQ r) (Rectangle point) Source #

HasPoints (Box point) (Box point') point point' Source # 
Instance details

Defined in HGeometry.Box.Internal

Methods

allPoints :: forall (d :: Nat) r r'. (Point_ point d r, Point_ point' d r', NumType (Box point) ~ r, NumType (Box point') ~ r', Dimension (Box point) ~ d, Dimension (Box point') ~ d) => Traversal1 (Box point) (Box point') point point' Source #

(Num r, Ord r, Point_ point 2 r) => HasIntersectionWith (LinePV 2 r) (Rectangle point) Source # 
Instance details

Defined in HGeometry.Box

Methods

intersects :: LinePV 2 r -> Rectangle point -> Bool Source #

(Ord r, Num r, Point_ point 2 r, Point_ point' 2 r, HasIntersectionWith (LineSegment endPoint point) (ClosedLineSegment point')) => HasIntersectionWith (LineSegment endPoint point) (Boundary (Rectangle point')) Source # 
Instance details

Defined in HGeometry.Box

Methods

intersects :: LineSegment endPoint point -> Boundary (Rectangle point') -> Bool Source #

(Ord r, Num r, Point_ point 2 r, Point_ point' 2 r, IxValue (endPoint point) ~ point, EndPoint_ (endPoint point), HasIntersectionWith (LineSegment endPoint point) (ClosedLineSegment point')) => HasIntersectionWith (LineSegment endPoint point) (Rectangle point') Source # 
Instance details

Defined in HGeometry.Box

Methods

intersects :: LineSegment endPoint point -> Rectangle point' -> Bool Source #

(Point_ point d r, Num r, Ord r, Foldable1 (Vector d), Zip (Vector d)) => HasIntersectionWith (Point d r) (Box point) Source # 
Instance details

Defined in HGeometry.Box

Methods

intersects :: Point d r -> Box point -> Bool Source #

(Fractional r, Ord r, Point_ point 2 r) => IsIntersectableWith (LinePV 2 r) (Rectangle point) Source # 
Instance details

Defined in HGeometry.Box

Methods

intersect :: LinePV 2 r -> Rectangle point -> Intersection (LinePV 2 r) (Rectangle point) Source #

(Point_ point d r, Num r, Ord r, Foldable1 (Vector d), Zip (Vector d)) => IsIntersectableWith (Point d r) (Box point) Source # 
Instance details

Defined in HGeometry.Box

Methods

intersect :: Point d r -> Box point -> Intersection (Point d r) (Box point) Source #

type Rep (Box point) Source # 
Instance details

Defined in HGeometry.Box.Internal

type Rep (Box point) = D1 ('MetaData "Box" "HGeometry.Box.Internal" "hgeometry-kernel-1.0.0.0-inplace" 'True) (C1 ('MetaCons "MkBox" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Vector 2 point))))
type Dimension (Box point) Source # 
Instance details

Defined in HGeometry.Box.Internal

type Dimension (Box point) = Dimension point
type NumType (Box point) Source # 
Instance details

Defined in HGeometry.Box.Internal

type NumType (Box point) = NumType point
type Intersection (Box point) (Box point) Source # 
Instance details

Defined in HGeometry.Box.Intersection

type Intersection (Box point) (Box point) = Maybe (Box (Point (Dimension point) (NumType point)))
type Intersection (HalfLine point) (Rectangle point) Source # 
Instance details

Defined in HGeometry.Box

type Intersection (VerticalOrLineEQ r) (Rectangle point) Source # 
Instance details

Defined in HGeometry.Box

type Intersection (LineEQ r) (Rectangle point) Source # 
Instance details

Defined in HGeometry.Box

type Intersection (LinePV 2 r) (Rectangle point) Source # 
Instance details

Defined in HGeometry.Box

type Intersection (Point d r) (Box point) Source # 
Instance details

Defined in HGeometry.Box

type Intersection (Point d r) (Box point) = Maybe (Point d r)

type Rectangle = Box Source #

Defines a rectangle

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

Instances details
Foldable1 Triangle Source # 
Instance details

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 # 
Instance details

Defined in HGeometry.Triangle

Methods

fmap :: (a -> b) -> Triangle a -> Triangle b Source #

(<$) :: a -> Triangle b -> Triangle a Source #

Foldable Triangle Source # 
Instance details

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 #

sum :: Num a => Triangle a -> a Source #

product :: Num a => Triangle a -> a Source #

Traversable Triangle Source # 
Instance details

Defined in HGeometry.Triangle

Methods

traverse :: Applicative f => (a -> f b) -> Triangle a -> f (Triangle b) Source #

sequenceA :: Applicative f => Triangle (f a) -> f (Triangle a) Source #

mapM :: Monad m => (a -> m b) -> Triangle a -> m (Triangle b) Source #

sequence :: Monad m => Triangle (m a) -> m (Triangle a) Source #

Traversable1 Triangle Source # 
Instance details

Defined in HGeometry.Triangle

Methods

traverse1 :: Apply f => (a -> f b) -> Triangle a -> f (Triangle b) Source #

sequence1 :: Apply f => Triangle (f b) -> f (Triangle b) Source #

Generic (Triangle point) Source # 
Instance details

Defined in HGeometry.Triangle

Associated Types

type Rep (Triangle point) 
Instance details

Defined in HGeometry.Triangle

type Rep (Triangle point) = D1 ('MetaData "Triangle" "HGeometry.Triangle" "hgeometry-kernel-1.0.0.0-inplace" 'True) (C1 ('MetaCons "MkTriangle" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Vector 3 point))))

Methods

from :: Triangle point -> Rep (Triangle point) x Source #

to :: Rep (Triangle point) x -> Triangle point Source #

Read point => Read (Triangle point) Source # 
Instance details

Defined in HGeometry.Triangle

Show point => Show (Triangle point) Source # 
Instance details

Defined in HGeometry.Triangle

Methods

showsPrec :: Int -> Triangle point -> ShowS Source #

show :: Triangle point -> String Source #

showList :: [Triangle point] -> ShowS Source #

Eq (Vector 3 point) => Eq (Triangle point) Source # 
Instance details

Defined in HGeometry.Triangle

Methods

(==) :: Triangle point -> Triangle point -> Bool Source #

(/=) :: Triangle point -> Triangle point -> Bool Source #

Ord (Vector 3 point) => Ord (Triangle point) Source # 
Instance details

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 # 
Instance details

Defined in HGeometry.Triangle

Methods

boundingBox :: forall (d0 :: Nat) r0. (d0 ~ Dimension (Triangle point), r0 ~ NumType (Triangle point), Ord r0) => Triangle point -> Box (Point d0 r0) Source #

(DefaultTransformByConstraints (Triangle point) d r, Point_ point d r) => IsTransformable (Triangle point) Source # 
Instance details

Defined in HGeometry.Triangle

Methods

transformBy :: Transformation (Dimension (Triangle point)) (NumType (Triangle point)) -> Triangle point -> Triangle point Source #

HasEdges' (Triangle point) Source # 
Instance details

Defined in HGeometry.Triangle

Associated Types

type Edge (Triangle point) 
Instance details

Defined in HGeometry.Triangle

type Edge (Triangle point) = (point, point)
type EdgeIx (Triangle point) 
Instance details

Defined in HGeometry.Triangle

type EdgeIx (Triangle point) = Int

Methods

edgeAt :: EdgeIx (Triangle point) -> IndexedTraversal' (EdgeIx (Triangle point)) (Triangle point) (Edge (Triangle point)) Source #

numEdges :: Triangle point -> Int Source #

HasVertices' (Triangle point) Source # 
Instance details

Defined in HGeometry.Triangle

Associated Types

type Vertex (Triangle point) 
Instance details

Defined in HGeometry.Triangle

type Vertex (Triangle point) = point
type VertexIx (Triangle point) 
Instance details

Defined in HGeometry.Triangle

type VertexIx (Triangle point) = Int
Reversing (Triangle point) Source # 
Instance details

Defined in HGeometry.Triangle

Methods

reversing :: Triangle point -> Triangle point Source #

Point_ vertex 3 r => CanComputeNormalVector (Triangle vertex) r Source # 
Instance details

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 # 
Instance details

Defined in HGeometry.Triangle

Methods

mkTriangle :: point -> point -> point -> Triangle point Source #

Point_ point (Dimension point) (NumType point) => Triangle_ (Triangle point) point Source # 
Instance details

Defined in HGeometry.Triangle

Methods

corners :: Lens' (Triangle point) (Vector 3 point) Source #

(Point_ point 3 r, Point_ point' 3 r, Fractional r, Ord r) => HasIntersectionWith (HalfLine point) (Triangle point') Source # 
Instance details

Defined in HGeometry.Triangle

Methods

intersects :: HalfLine point -> Triangle point' -> Bool Source #

(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

Instance details

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 # 
Instance details

Defined in HGeometry.Triangle

Methods

intersects :: Triangle corner -> Triangle vertex -> Bool Source #

(Point_ point 3 r, Point_ point' 3 r, Fractional r, Ord r) => IsIntersectableWith (HalfLine point) (Triangle point') Source # 
Instance details

Defined in HGeometry.Triangle

Methods

intersect :: HalfLine point -> Triangle point' -> Intersection (HalfLine point) (Triangle point') Source #

HasVertices (Triangle point) (Triangle point') Source # 
Instance details

Defined in HGeometry.Triangle

Methods

vertices :: IndexedTraversal1 (VertexIx (Triangle point)) (Triangle point) (Triangle point') (Vertex (Triangle point)) (Vertex (Triangle point')) Source #

HasPoints (Triangle point) (Triangle point') point point' Source # 
Instance details

Defined in HGeometry.Triangle

Methods

allPoints :: forall (d :: Nat) r r'. (Point_ point d r, Point_ point' d r', NumType (Triangle point) ~ r, NumType (Triangle point') ~ r', Dimension (Triangle point) ~ d, Dimension (Triangle point') ~ d) => Traversal1 (Triangle point) (Triangle point') point point' Source #

(Point_ point 3 r, Fractional r, Ord r) => HasIntersectionWith (LinePV 3 r) (Triangle point) Source # 
Instance details

Defined in HGeometry.Triangle

Methods

intersects :: LinePV 3 r -> Triangle point -> Bool Source #

(Point_ point 2 r, Num r, Ord r) => HasIntersectionWith (Point 2 r) (Triangle point) Source # 
Instance details

Defined in HGeometry.Triangle

Methods

intersects :: Point 2 r -> Triangle point -> Bool Source #

(Point_ point 3 r, Fractional r, Ord r) => IsIntersectableWith (LinePV 3 r) (Triangle point) Source # 
Instance details

Defined in HGeometry.Triangle

Methods

intersect :: LinePV 3 r -> Triangle point -> Intersection (LinePV 3 r) (Triangle point) Source #

type Rep (Triangle point) Source # 
Instance details

Defined in HGeometry.Triangle

type Rep (Triangle point) = D1 ('MetaData "Triangle" "HGeometry.Triangle" "hgeometry-kernel-1.0.0.0-inplace" 'True) (C1 ('MetaCons "MkTriangle" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Vector 3 point))))
type Dimension (Triangle point) Source # 
Instance details

Defined in HGeometry.Triangle

type Dimension (Triangle point) = Dimension point
type NumType (Triangle point) Source # 
Instance details

Defined in HGeometry.Triangle

type NumType (Triangle point) = NumType point
type Edge (Triangle point) Source # 
Instance details

Defined in HGeometry.Triangle

type Edge (Triangle point) = (point, point)
type EdgeIx (Triangle point) Source # 
Instance details

Defined in HGeometry.Triangle

type EdgeIx (Triangle point) = Int
type Vertex (Triangle point) Source # 
Instance details

Defined in HGeometry.Triangle

type Vertex (Triangle point) = point
type VertexIx (Triangle point) Source # 
Instance details

Defined in HGeometry.Triangle

type VertexIx (Triangle point) = Int
type Intersection (HalfLine point) (Triangle point') Source #

Same here, we also return the parameter at which the ray intersects the point

Instance details

Defined in HGeometry.Triangle

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

Instance details

Defined in HGeometry.Triangle