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

HGeometry.Line.LineEQ

Description

Non-vertical Lines in R^2 given by the equation \(y = ax + b\)

Synopsis

Documentation

newtype LineEQ r Source #

A non-vertical Line represented by its equation \(y = ax + b\)

see toLinearFunction in the PointAndVector module to construct a line from a point and a vector.

Constructors

MkLineEQ (NonVerticalHyperPlane 2 r) 

Bundled Patterns

pattern LineEQ :: r -> r -> LineEQ r

Constructs a line in R^2, i.e. a line for the equation \(y = ax + b\)

Instances

Instances details
NFData r => NFData (LineEQ r) Source # 
Instance details

Defined in HGeometry.Line.LineEQ

Methods

rnf :: LineEQ r -> () Source #

Generic (LineEQ r) Source # 
Instance details

Defined in HGeometry.Line.LineEQ

Associated Types

type Rep (LineEQ r) 
Instance details

Defined in HGeometry.Line.LineEQ

type Rep (LineEQ r) = D1 ('MetaData "LineEQ" "HGeometry.Line.LineEQ" "hgeometry-kernel-1.0.0.0-inplace" 'True) (C1 ('MetaCons "MkLineEQ" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonVerticalHyperPlane 2 r))))

Methods

from :: LineEQ r -> Rep (LineEQ r) x Source #

to :: Rep (LineEQ r) x -> LineEQ r Source #

Read r => Read (LineEQ r) Source # 
Instance details

Defined in HGeometry.Line.LineEQ

Show r => Show (LineEQ r) Source # 
Instance details

Defined in HGeometry.Line.LineEQ

Eq r => Eq (LineEQ r) Source # 
Instance details

Defined in HGeometry.Line.LineEQ

Methods

(==) :: LineEQ r -> LineEQ r -> Bool Source #

(/=) :: LineEQ r -> LineEQ r -> Bool Source #

Ord r => Ord (LineEQ r) Source # 
Instance details

Defined in HGeometry.Line.LineEQ

Methods

compare :: LineEQ r -> LineEQ r -> Ordering Source #

(<) :: LineEQ r -> LineEQ r -> Bool Source #

(<=) :: LineEQ r -> LineEQ r -> Bool Source #

(>) :: LineEQ r -> LineEQ r -> Bool Source #

(>=) :: LineEQ r -> LineEQ r -> Bool Source #

max :: LineEQ r -> LineEQ r -> LineEQ r Source #

min :: LineEQ r -> LineEQ r -> LineEQ r Source #

Fractional r => HasSquaredEuclideanDistance (LineEQ r) Source # 
Instance details

Defined in HGeometry.Line

Methods

squaredEuclideanDistTo :: forall r0 (d :: Nat) point. (r0 ~ NumType (LineEQ r), d ~ Dimension (LineEQ r), Num r0, Point_ point d r0) => point -> LineEQ r -> r0 Source #

pointClosestTo :: forall r0 (d :: Nat) point. (r0 ~ NumType (LineEQ r), d ~ Dimension (LineEQ r), Num r0, Point_ point d r0) => point -> LineEQ r -> Point d r0 Source #

pointClosestToWithDistance :: forall r0 (d :: Nat) point. (r0 ~ NumType (LineEQ r), d ~ Dimension (LineEQ r), Num r0, Point_ point d r0) => point -> LineEQ r -> (Point d r0, r0) Source #

HasOnLine (LineEQ r) 2 Source # 
Instance details

Defined in HGeometry.Line.LineEQ

Methods

onLine :: (Point_ point 2 r0, Num r0, Eq r0, r0 ~ NumType (LineEQ r), 2 ~ Dimension (LineEQ r)) => point -> LineEQ r -> Bool Source #

(MkHyperPlaneConstraints 2 r, Fractional r, Eq r) => ConstructableHyperPlane_ (LineEQ r) 2 r Source # 
Instance details

Defined in HGeometry.Line.LineEQ

Associated Types

type HyperPlaneFromEquationConstraint (LineEQ r) 2 r 
Instance details

Defined in HGeometry.Line.LineEQ

Methods

hyperPlaneFromEquation :: Vector (2 + 1) r -> LineEQ r Source #

fromPointAndNormal :: (Point_ point 2 r, Num r) => point -> Vector 2 r -> LineEQ r Source #

MkHyperPlaneConstraints 2 r => HyperPlane_ (LineEQ r) 2 r Source # 
Instance details

Defined in HGeometry.Line.LineEQ

Methods

evalHyperPlaneEquation :: (Num r, Point_ point 2 r) => LineEQ r -> point -> r Source #

hyperPlaneEquation :: LineEQ r -> Vector (2 + 1) r Source #

normalVector :: LineEQ r -> Vector 2 r Source #

onHyperPlane :: (Point_ point 2 r, Eq r, Num r) => point -> LineEQ r -> Bool Source #

onSideTest :: (Point_ point 2 r, Ord r, Num r) => point -> LineEQ r -> Ordering Source #

(MkHyperPlaneConstraints 2 r, Num r) => NonVerticalHyperPlane_ (LineEQ r) 2 r Source # 
Instance details

Defined in HGeometry.Line.LineEQ

Methods

evalAt :: (Num r, 1 <= 2, Point_ point (2 - 1) r) => point -> LineEQ r -> r Source #

hyperPlaneCoefficients :: Lens' (LineEQ r) (Vector 2 r) Source #

verticalSideTest :: (1 <= 2, Point_ point 2 r, Ord r, Num r) => point -> LineEQ r -> Ordering Source #

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

Eq r => HasIntersectionWith (LineEQ r) (VerticalOrLineEQ r) Source # 
Instance details

Defined in HGeometry.Line.General

Eq r => HasIntersectionWith (LineEQ r) (LineEQ r) Source # 
Instance details

Defined in HGeometry.Line.LineEQ

Methods

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

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

(Eq r, Fractional r) => IsIntersectableWith (LineEQ r) (VerticalOrLineEQ r) Source # 
Instance details

Defined in HGeometry.Line.General

(Eq r, Fractional r) => IsIntersectableWith (LineEQ r) (LineEQ r) Source # 
Instance details

Defined in HGeometry.Line.LineEQ

Methods

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

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

Defined in HGeometry.LineSegment.Intersection

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

Defined in HGeometry.LineSegment.Intersection

(Eq r, Fractional r) => HasIntersectionWith (LineEQ r) (HyperPlane 2 r) Source # 
Instance details

Defined in HGeometry.Line.LineEQ

Methods

intersects :: LineEQ r -> HyperPlane 2 r -> Bool Source #

(Eq r, Num r) => HasIntersectionWith (LineEQ r) (LinePV 2 r) Source # 
Instance details

Defined in HGeometry.Line

Methods

intersects :: LineEQ r -> LinePV 2 r -> Bool Source #

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

Defined in HGeometry.LineSegment.Intersection

Methods

intersects :: LineEQ r -> LineSegment endPoint point -> Bool Source #

(Eq r, Fractional r) => IsIntersectableWith (LineEQ r) (HyperPlane 2 r) Source # 
Instance details

Defined in HGeometry.Line.LineEQ

(Ord r, Fractional r) => IsIntersectableWith (LineEQ r) (LinePV 2 r) Source # 
Instance details

Defined in HGeometry.Line

Methods

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

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

Defined in HGeometry.LineSegment.Intersection

(HasIntersectionWith (LineEQ r :+ extra) (LineEQ r :+ extra'), Fractional r, Eq r) => IsIntersectableWith (LineEQ r :+ extra) (LineEQ r :+ extra') Source # 
Instance details

Defined in HGeometry.Line.LineEQ

Methods

intersect :: (LineEQ r :+ extra) -> (LineEQ r :+ extra') -> Intersection (LineEQ r :+ extra) (LineEQ r :+ extra') Source #

type Rep (LineEQ r) Source # 
Instance details

Defined in HGeometry.Line.LineEQ

type Rep (LineEQ r) = D1 ('MetaData "LineEQ" "HGeometry.Line.LineEQ" "hgeometry-kernel-1.0.0.0-inplace" 'True) (C1 ('MetaCons "MkLineEQ" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonVerticalHyperPlane 2 r))))
type Dimension (LineEQ r) Source # 
Instance details

Defined in HGeometry.Line.LineEQ

type Dimension (LineEQ r) = 2
type NumType (LineEQ r) Source # 
Instance details

Defined in HGeometry.Line.LineEQ

type NumType (LineEQ r) = r
type HyperPlaneFromEquationConstraint (LineEQ r) 2 r Source # 
Instance details

Defined in HGeometry.Line.LineEQ

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

Defined in HGeometry.Box

type Intersection (LineEQ r) (VerticalOrLineEQ r) Source # 
Instance details

Defined in HGeometry.Line.General

type Intersection (LineEQ r) (LineEQ r) Source #

The intersection of two lines is either: NoIntersection, a point or a line.

Instance details

Defined in HGeometry.Line.LineEQ

type Intersection (LineEQ r) (HyperPlane 2 r) Source # 
Instance details

Defined in HGeometry.Line.LineEQ

type Intersection (LineEQ r) (LinePV 2 r) Source # 
Instance details

Defined in HGeometry.Line

type Intersection (LineEQ r) (LineSegment AnEndPoint point) Source # 
Instance details

Defined in HGeometry.LineSegment.Intersection

type Intersection (LineEQ r) (LineSegment (EndPoint t) point) Source # 
Instance details

Defined in HGeometry.LineSegment.Intersection

type Intersection (LineEQ r :+ extra) (LineEQ r :+ extra') Source # 
Instance details

Defined in HGeometry.Line.LineEQ

type Intersection (LineEQ r :+ extra) (LineEQ r :+ extra') = Maybe (LineLineIntersection (LineEQ r :+ extra))

evalAt' :: Num r => r -> LineEQ r -> r Source #

Evaluate the line at at given position.