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

HGeometry.HalfLine

Description

Half-lines in \(d\)-dimensional space.

Synopsis

Documentation

data HalfLine point Source #

A Halfline in R^d

Constructors

HalfLine !point !(Vector (Dimension point) (NumType point)) 

Instances

Instances details
(Read r, Read point, Has_ Additive_ d r, KnownNat d, d ~ Dimension point, r ~ NumType point) => Read (HalfLine point) Source # 
Instance details

Defined in HGeometry.HalfLine

(Show point, Show r, d ~ Dimension point, r ~ NumType point, KnownNat d, Has_ Additive_ d r) => Show (HalfLine point) Source # 
Instance details

Defined in HGeometry.HalfLine

Methods

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

show :: HalfLine point -> String Source #

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

(Eq point, Eq (Vector d r), d ~ Dimension point, r ~ NumType point) => Eq (HalfLine point) Source # 
Instance details

Defined in HGeometry.HalfLine

Methods

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

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

HasDirection (HalfLine point) Source # 
Instance details

Defined in HGeometry.HalfLine

Methods

direction :: forall (d :: Nat) r. (Dimension (HalfLine point) ~ d, NumType (HalfLine point) ~ r) => Lens' (HalfLine point) (Vector d r) Source #

Point_ point d r => HasSupportingLine (HalfLine point) Source # 
Instance details

Defined in HGeometry.HalfLine

Methods

supportingLine :: HalfLine point -> LinePV (Dimension (HalfLine point)) (NumType (HalfLine point)) Source #

(Point_ point d r, Has_ Metric_ d r, Ord r, Fractional r, MkHyperPlaneConstraints d r) => HasSquaredEuclideanDistance (HalfLine point) Source # 
Instance details

Defined in HGeometry.HalfLine

Methods

squaredEuclideanDistTo :: forall r0 (d0 :: Nat) point0. (r0 ~ NumType (HalfLine point), d0 ~ Dimension (HalfLine point), Num r0, Point_ point0 d0 r0) => point0 -> HalfLine point -> r0 Source #

pointClosestTo :: forall r0 (d0 :: Nat) point0. (r0 ~ NumType (HalfLine point), d0 ~ Dimension (HalfLine point), Num r0, Point_ point0 d0 r0) => point0 -> HalfLine point -> Point d0 r0 Source #

pointClosestToWithDistance :: forall r0 (d0 :: Nat) point0. (r0 ~ NumType (HalfLine point), d0 ~ Dimension (HalfLine point), Num r0, Point_ point0 d0 r0) => point0 -> HalfLine point -> (Point d0 r0, r0) Source #

HasStart (HalfLine point) point Source # 
Instance details

Defined in HGeometry.HalfLine

Methods

start :: Lens' (HalfLine point) point 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 #

(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 d r, Point_ point' d r, Ord r, Fractional r, Has_ Metric_ d r, HasSquaredEuclideanDistance point', MkHyperPlaneConstraints d r) => HasIntersectionWith (HalfLine point') (Ball point) Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

Methods

intersects :: HalfLine point' -> Ball point -> Bool 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 #

(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 #

(Point_ point d r, Point_ point' d r, Ord r, Fractional r, Radical r, Has_ Metric_ d r, MkHyperPlaneConstraints d r, HasSquaredEuclideanDistance point') => IsIntersectableWith (HalfLine point') (Ball point) Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

Methods

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

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

Defined in HGeometry.LineSegment.Intersection

Methods

intersects :: HalfLine point -> LineSegment endPoint point -> Bool Source #

(Ord r, Fractional r, Point_ point 2 r, IxValue (endPoint point) ~ point, EndPoint_ (endPoint point), IsIntersectableWith (LinePV 2 r) (LineSegment endPoint point), Intersection (LinePV 2 r) (LineSegment endPoint point) ~ Maybe (LineLineSegmentIntersection lineSegment'), NumType lineSegment' ~ r) => IsIntersectableWith (HalfLine point) (LineSegment endPoint point) Source # 
Instance details

Defined in HGeometry.LineSegment.Intersection

Methods

intersect :: HalfLine point -> LineSegment endPoint point -> Intersection (HalfLine point) (LineSegment endPoint point) Source #

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

Defined in HGeometry.HalfLine

Methods

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

(Point_ point d r, Ord r, Num r, HasOnLine (LinePV d r) d, Has_ Metric_ d r, Has_ Metric_ (d + 1) r, Has_ Vector_ (1 + d) r, d < (d + 1), d <= (d + 1)) => HasIntersectionWith (Point d r) (HalfLine point) Source # 
Instance details

Defined in HGeometry.HalfLine

Methods

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

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

Defined in HGeometry.HalfLine

Methods

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

type Dimension (HalfLine point) Source # 
Instance details

Defined in HGeometry.HalfLine

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

Defined in HGeometry.HalfLine

type NumType (HalfLine point) = NumType point
type Intersection (HalfLine point) (Rectangle point) Source # 
Instance details

Defined in HGeometry.Box

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 (HalfLine point') (Ball point) Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

type Intersection (HalfLine point') (Ball point) = Maybe (IntersectionOf (LinePV (Dimension point) (NumType point)) (Ball point))
type Intersection (HalfLine point) (LineSegment endPoint point) Source # 
Instance details

Defined in HGeometry.LineSegment.Intersection

type Intersection (HalfLine point) (LineSegment endPoint point) = Maybe (HalfLineLineSegmentIntersection (Point 2 (NumType point)) (LineSegment endPoint point))
type Intersection (LinePV 2 r) (HalfLine point) Source # 
Instance details

Defined in HGeometry.HalfLine

asOrientedLine :: forall point (d :: Nat) r. Point_ point d r => HalfLine point -> LinePV d r Source #

Convert the Halfline into an oriented line.

halfLineThrough :: forall point (d :: Nat) r. (Point_ point d r, Num r) => point -> point -> HalfLine point Source #

Given two points p and q, create a halfline from p through q.

>>> halfLineThrough (Point2 5 10) (Point2 10 30 :: Point 2 Int)
HalfLine (Point2 5 10) (Vector2 5 20)

data LineHalfLineIntersection point halfLine Source #

Data type representing the intersection of a Line and a HalfLine

Constructors

Line_x_HalfLine_Point point 
Line_x_HalfLine_HalfLine halfLine 

Instances

Instances details
Functor (LineHalfLineIntersection point) Source # 
Instance details

Defined in HGeometry.HalfLine

Generic (LineHalfLineIntersection point halfLine) Source # 
Instance details

Defined in HGeometry.HalfLine

Associated Types

type Rep (LineHalfLineIntersection point halfLine) 
Instance details

Defined in HGeometry.HalfLine

type Rep (LineHalfLineIntersection point halfLine) = D1 ('MetaData "LineHalfLineIntersection" "HGeometry.HalfLine" "hgeometry-kernel-1.0.0.0-inplace" 'False) (C1 ('MetaCons "Line_x_HalfLine_Point" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 point)) :+: C1 ('MetaCons "Line_x_HalfLine_HalfLine" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 halfLine)))

Methods

from :: LineHalfLineIntersection point halfLine -> Rep (LineHalfLineIntersection point halfLine) x Source #

to :: Rep (LineHalfLineIntersection point halfLine) x -> LineHalfLineIntersection point halfLine Source #

(Read point, Read halfLine) => Read (LineHalfLineIntersection point halfLine) Source # 
Instance details

Defined in HGeometry.HalfLine

(Show point, Show halfLine) => Show (LineHalfLineIntersection point halfLine) Source # 
Instance details

Defined in HGeometry.HalfLine

(Eq point, Eq halfLine) => Eq (LineHalfLineIntersection point halfLine) Source # 
Instance details

Defined in HGeometry.HalfLine

Methods

(==) :: LineHalfLineIntersection point halfLine -> LineHalfLineIntersection point halfLine -> Bool Source #

(/=) :: LineHalfLineIntersection point halfLine -> LineHalfLineIntersection point halfLine -> Bool Source #

(Ord point, Ord halfLine) => Ord (LineHalfLineIntersection point halfLine) Source # 
Instance details

Defined in HGeometry.HalfLine

Methods

compare :: LineHalfLineIntersection point halfLine -> LineHalfLineIntersection point halfLine -> Ordering Source #

(<) :: LineHalfLineIntersection point halfLine -> LineHalfLineIntersection point halfLine -> Bool Source #

(<=) :: LineHalfLineIntersection point halfLine -> LineHalfLineIntersection point halfLine -> Bool Source #

(>) :: LineHalfLineIntersection point halfLine -> LineHalfLineIntersection point halfLine -> Bool Source #

(>=) :: LineHalfLineIntersection point halfLine -> LineHalfLineIntersection point halfLine -> Bool Source #

max :: LineHalfLineIntersection point halfLine -> LineHalfLineIntersection point halfLine -> LineHalfLineIntersection point halfLine Source #

min :: LineHalfLineIntersection point halfLine -> LineHalfLineIntersection point halfLine -> LineHalfLineIntersection point halfLine Source #

type Rep (LineHalfLineIntersection point halfLine) Source # 
Instance details

Defined in HGeometry.HalfLine

type Rep (LineHalfLineIntersection point halfLine) = D1 ('MetaData "LineHalfLineIntersection" "HGeometry.HalfLine" "hgeometry-kernel-1.0.0.0-inplace" 'False) (C1 ('MetaCons "Line_x_HalfLine_Point" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 point)) :+: C1 ('MetaCons "Line_x_HalfLine_HalfLine" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 halfLine)))

class HasDirection t where Source #

Types that have a Direction field

Methods

direction :: forall (d :: Nat) r. (Dimension t ~ d, NumType t ~ r) => Lens' t (Vector d r) Source #

Lens to access the direction field

Instances

Instances details
HasDirection (HalfLine point) Source # 
Instance details

Defined in HGeometry.HalfLine

Methods

direction :: forall (d :: Nat) r. (Dimension (HalfLine point) ~ d, NumType (HalfLine point) ~ r) => Lens' (HalfLine point) (Vector d r) Source #

HasDirection (LinePV d r) Source # 
Instance details

Defined in HGeometry.Line.PointAndVector

Methods

direction :: forall (d0 :: Nat) r0. (Dimension (LinePV d r) ~ d0, NumType (LinePV d r) ~ r0) => Lens' (LinePV d r) (Vector d0 r0) Source #