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

HGeometry.HyperPlane.NonVertical

Description

Non-vertical hyperplanes in d-dimensional space.

Synopsis

Documentation

newtype NonVerticalHyperPlane (d :: Nat) r Source #

A non-vertical Hyperplane described by ( x_d = a_d + sum_{i=1}^{d-1} a_i * x_i ) where \(\langle a_1,..,a_d \rangle \) are the coefficients of te hyperplane.

e.g. the myLineAsNV defines the hyperplane (i.e. the line) described by

y = 2 + 1*x

Constructors

NonVerticalHyperPlane (Vector d r) 

Bundled Patterns

pattern Plane :: r -> r -> r -> Plane r

Constructs a Plane in R^3 for the equation z = ax + by + c

Instances

Instances details
Functor (Vector d) => Functor (NonVerticalHyperPlane d) Source # 
Instance details

Defined in HGeometry.HyperPlane.NonVertical

Foldable (Vector d) => Foldable (NonVerticalHyperPlane d) Source # 
Instance details

Defined in HGeometry.HyperPlane.NonVertical

Methods

fold :: Monoid m => NonVerticalHyperPlane d m -> m Source #

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

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

foldr :: (a -> b -> b) -> b -> NonVerticalHyperPlane d a -> b Source #

foldr' :: (a -> b -> b) -> b -> NonVerticalHyperPlane d a -> b Source #

foldl :: (b -> a -> b) -> b -> NonVerticalHyperPlane d a -> b Source #

foldl' :: (b -> a -> b) -> b -> NonVerticalHyperPlane d a -> b Source #

foldr1 :: (a -> a -> a) -> NonVerticalHyperPlane d a -> a Source #

foldl1 :: (a -> a -> a) -> NonVerticalHyperPlane d a -> a Source #

toList :: NonVerticalHyperPlane d a -> [a] Source #

null :: NonVerticalHyperPlane d a -> Bool Source #

length :: NonVerticalHyperPlane d a -> Int Source #

elem :: Eq a => a -> NonVerticalHyperPlane d a -> Bool Source #

maximum :: Ord a => NonVerticalHyperPlane d a -> a Source #

minimum :: Ord a => NonVerticalHyperPlane d a -> a Source #

sum :: Num a => NonVerticalHyperPlane d a -> a Source #

product :: Num a => NonVerticalHyperPlane d a -> a Source #

Traversable (Vector d) => Traversable (NonVerticalHyperPlane d) Source # 
Instance details

Defined in HGeometry.HyperPlane.NonVertical

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

Defined in HGeometry.HyperPlane.Intersection

Methods

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

NFData (Vector d r) => NFData (NonVerticalHyperPlane d r) Source # 
Instance details

Defined in HGeometry.HyperPlane.NonVertical

Methods

rnf :: NonVerticalHyperPlane d r -> () Source #

(Read r, Has_ Vector_ d r) => Read (NonVerticalHyperPlane d r) Source # 
Instance details

Defined in HGeometry.HyperPlane.NonVertical

Read r => Read (NonVerticalHyperPlane 3 r) Source # 
Instance details

Defined in HGeometry.HyperPlane.NonVertical

(Show r, Foldable (Vector d)) => Show (NonVerticalHyperPlane d r) Source # 
Instance details

Defined in HGeometry.HyperPlane.NonVertical

Show r => Show (NonVerticalHyperPlane 3 r) Source # 
Instance details

Defined in HGeometry.HyperPlane.NonVertical

Eq (Vector d r) => Eq (NonVerticalHyperPlane d r) Source # 
Instance details

Defined in HGeometry.HyperPlane.NonVertical

Ord (Vector d r) => Ord (NonVerticalHyperPlane d r) Source # 
Instance details

Defined in HGeometry.HyperPlane.NonVertical

(MkHyperPlaneConstraints d r, Has_ Additive_ (d - 1) r, Fractional r, Eq r, 2 <= d, (d - 1) <= d, 1 <= d, (1 + (d - 1)) ~ d, 0 <= ((d + 1) - 1), KnownNat (d - 1), ((d - 1) + 1) ~ d) => ConstructableHyperPlane_ (NonVerticalHyperPlane d r) d r Source # 
Instance details

Defined in HGeometry.HyperPlane.NonVertical

(MkHyperPlaneConstraints d r, Has_ Additive_ (d - 1) r, 2 <= d, (d - 1) <= d, 1 <= d, (1 + (d - 1)) ~ d, ((d - 1) + 1) ~ d) => HyperPlane_ (NonVerticalHyperPlane d r) d r Source # 
Instance details

Defined in HGeometry.HyperPlane.NonVertical

Methods

evalHyperPlaneEquation :: (Num r, Point_ point d r) => NonVerticalHyperPlane d r -> point -> r Source #

hyperPlaneEquation :: NonVerticalHyperPlane d r -> Vector (d + 1) r Source #

normalVector :: NonVerticalHyperPlane d r -> Vector d r Source #

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

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

(MkHyperPlaneConstraints d r, (1 + (d - 1)) ~ d, Has_ Additive_ (d - 1) r, Num r, 2 <= d, (d - 1) <= d, 1 <= d, (1 + (d - 1)) ~ d, ((d - 1) + 1) ~ d) => NonVerticalHyperPlane_ (NonVerticalHyperPlane d r) d r Source # 
Instance details

Defined in HGeometry.HyperPlane.NonVertical

Methods

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

hyperPlaneCoefficients :: Lens' (NonVerticalHyperPlane d r) (Vector d r) Source #

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

(Has_ Metric_ d r, Num r, Eq r, 2 <= d, d < (d + 1), Has_ Metric_ (1 + d) r, Has_ Additive_ (d - 1) r, Eq (Vector d r), 1 <= d, Has_ Metric_ (d + 1) r, (1 + (d - 1)) ~ d, d <= (d + 1), (d - 1) <= d, ((d - 1) + 1) ~ d) => HasIntersectionWith (NonVerticalHyperPlane d r) (NonVerticalHyperPlane d r) Source # 
Instance details

Defined in HGeometry.HyperPlane.Intersection

type Intersection (Plane r) (Plane r) Source # 
Instance details

Defined in HGeometry.HyperPlane.Intersection

type Dimension (NonVerticalHyperPlane d r) Source # 
Instance details

Defined in HGeometry.HyperPlane.NonVertical

type NumType (NonVerticalHyperPlane d r) Source # 
Instance details

Defined in HGeometry.HyperPlane.NonVertical

type HyperPlaneFromEquationConstraint (NonVerticalHyperPlane d r) d r Source # 
Instance details

Defined in HGeometry.HyperPlane.NonVertical

asNonVerticalHyperPlane :: forall hyperPlane (d :: Natural) r. (HyperPlane_ hyperPlane d r, Fractional r, Eq r, 1 <= d, Has_ Vector_ (d + 1) r, d <= (d + 1), KnownNat (d - 1), 0 <= ((d + 1) - 1)) => hyperPlane -> Maybe (NonVerticalHyperPlane d r) Source #

Try to construct a Non-vertical hyperplane out of some generic hyperplane.

>>> asNonVerticalHyperPlane $ (HyperPlane2 10 1 2 :: HyperPlane 2 Double)
Just (NonVerticalHyperPlane [-0.5,-5.0])
>>> asNonVerticalHyperPlane $ (HyperPlane2 10 1 0 :: HyperPlane 2 Double)
Nothing
>>> asNonVerticalHyperPlane myOtherLine
Just (NonVerticalHyperPlane [-1.5,-2.0])
>>> asNonVerticalHyperPlane myPlane
Just (Plane 2.0 3.0 10.0)

type Plane = NonVerticalHyperPlane 3 Source #

Shorthand for non-vertical hyperplanes in R^3