hgeometry-1.0.0.0: Geometric Algorithms, Data structures, and Data types.
Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellSafe-Inferred
LanguageGHC2021

HGeometry.HyperPlane.NonVertical

Description

Non-vertical hyperplanes in d-dimensional space.

Synopsis

Documentation

newtype NonVerticalHyperPlane d 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
Foldable (Vector d) => Foldable (NonVerticalHyperPlane d) Source # 
Instance details

Defined in HGeometry.HyperPlane.NonVertical

Methods

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

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

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

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

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

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

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

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

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

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

null :: NonVerticalHyperPlane d a -> Bool #

length :: NonVerticalHyperPlane d a -> Int #

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

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

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

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

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

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

Defined in HGeometry.HyperPlane.NonVertical

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

Defined in HGeometry.HyperPlane.NonVertical

(Read r, Has_ Vector_ d r) => Read (NonVerticalHyperPlane d 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

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

Defined in HGeometry.HyperPlane.NonVertical

Methods

rnf :: NonVerticalHyperPlane d r -> () #

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, Fractional r, Eq r, 2 <= d) => ConstructableHyperPlane_ (NonVerticalHyperPlane d r) d r Source # 
Instance details

Defined in HGeometry.HyperPlane.NonVertical

(MkHyperPlaneConstraints d r, 2 <= 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, Num r, 2 <= 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 #

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 :: (HyperPlane_ hyperPlane d r, Fractional r, Eq r, 1 <= d) => 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 (NonVerticalHyperPlane [2.0,3.0,10.0])

type Plane = NonVerticalHyperPlane 3 Source #

Shorthand for non-vertical hyperplanes in R^3

type Plane_ plane = NonVerticalHyperPlane_ plane 3 Source #

Shorthand for Non-vertical hyperplanes in R^3

pattern Plane_ :: Plane_ plane r => r -> r -> r -> plane Source #

Destructs a Plane in R^3 into the equation z = ax + by + c