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

HGeometry.HyperPlane

Description

Hyperplanes in \(d\)-dimensional space.

Synopsis

Documentation

newtype HyperPlane (d :: Natural) r Source #

A Hyperplane h in d-dimensions, described by a vector of coefficients (a_0,..,a_d).

a point \( (p_1,..,p_d) \) lies on (h) iff: \( a_0 + \sum_i=1^d a_i*p_i = 0 \)

Constructors

HyperPlane (Vector (d + 1) r) 

Bundled Patterns

pattern HyperPlane2 :: r -> r -> r -> HyperPlane 2 r

Construct a Hyperplane, i.e. a line in R^2

HyperPlane2 c a b represents the line ax + by + c = 0

pattern HyperPlane3 :: r -> r -> r -> r -> HyperPlane 3 r

Construct a plane in R^3

HyperPlane3 d a b c represnest the plane ax + by + cz + d = 0

Instances

Instances details
(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, Fractional r) => IsIntersectableWith (LineEQ r) (HyperPlane 2 r) Source # 
Instance details

Defined in HGeometry.Line.LineEQ

(Read r, Has_ Vector_ (d + 1) r) => Read (HyperPlane d r) Source # 
Instance details

Defined in HGeometry.HyperPlane.Internal

(Show r, Foldable (Vector (d + 1))) => Show (HyperPlane d r) Source # 
Instance details

Defined in HGeometry.HyperPlane.Internal

Eq (Vector (d + 1) r) => Eq (HyperPlane d r) Source # 
Instance details

Defined in HGeometry.HyperPlane.Internal

Methods

(==) :: HyperPlane d r -> HyperPlane d r -> Bool Source #

(/=) :: HyperPlane d r -> HyperPlane d r -> Bool Source #

Eq r => HyperPlaneFromPoints (HyperPlane 2 r) Source # 
Instance details

Defined in HGeometry.HyperPlane.Internal

Methods

hyperPlaneThrough :: forall point (d :: Nat) r0. (Point_ point d r0, HyperPlane_ (HyperPlane 2 r) d r0, Num r0) => Vector d point -> HyperPlane 2 r Source #

Num r => HyperPlaneFromPoints (HyperPlane 3 r) Source # 
Instance details

Defined in HGeometry.HyperPlane.Internal

Methods

hyperPlaneThrough :: forall point (d :: Nat) r0. (Point_ point d r0, HyperPlane_ (HyperPlane 3 r) d r0, Num r0) => Vector d point -> HyperPlane 3 r Source #

MkHyperPlaneConstraints d r => ConstructableHyperPlane_ (HyperPlane d r) d r Source # 
Instance details

Defined in HGeometry.HyperPlane.Internal

Associated Types

type HyperPlaneFromEquationConstraint (HyperPlane d r) d r 
Instance details

Defined in HGeometry.HyperPlane.Internal

Methods

hyperPlaneFromEquation :: Vector (d + 1) r -> HyperPlane d r Source #

fromPointAndNormal :: (Point_ point d r, Num r) => point -> Vector d r -> HyperPlane d r Source #

MkHyperPlaneConstraints d r => HyperPlane_ (HyperPlane d r) d r Source # 
Instance details

Defined in HGeometry.HyperPlane.Internal

Methods

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

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

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

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

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

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

Defined in HGeometry.HyperPlane.Intersection

Methods

intersects :: HyperPlane d r -> HyperPlane d r -> Bool Source #

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

Defined in HGeometry.Line.LineEQ

type Dimension (HyperPlane d r) Source # 
Instance details

Defined in HGeometry.HyperPlane.Internal

type Dimension (HyperPlane d r) = d
type NumType (HyperPlane d r) Source # 
Instance details

Defined in HGeometry.HyperPlane.Internal

type NumType (HyperPlane d r) = r
type HyperPlaneFromEquationConstraint (HyperPlane d r) d r Source # 
Instance details

Defined in HGeometry.HyperPlane.Internal

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

Defined in HGeometry.Line.LineEQ

type Intersection (HyperPlane 3 r) (HyperPlane 3 r) Source # 
Instance details

Defined in HGeometry.HyperPlane.Intersection

type MkHyperPlaneConstraints (d :: Natural) r = (d < (d + 1), KnownNat d, Has_ Metric_ d r, Has_ Metric_ (d + 1) r, Has_ Vector_ d r, Has_ Vector_ (d + 1) r, Has_ Vector_ (1 + d) r, d <= (d + 1)) Source #

Constraints on d needed to be able to construct hyperplanes; pretty much all of these are satisfied by default, it is just that the typechecker does not realize that.

cmpInDirection :: forall point (d :: Natural) r. (Ord r, Num r, Has_ Metric_ (d + 1) r, Has_ Metric_ d r, Point_ point d r, d < (d + 1), Has_ Vector_ (1 + d) r, d <= (d + 1)) => Vector d r -> point -> point -> Ordering Source #

Compare points with respect to the direction given by the vector, i.e. by taking planes whose normal is the given vector.

data PlanePlaneIntersection plane line Source #

The intersection between two planes in R^3.

Constructors

Plane_x_Plane_Line line 
Plane_x_Plane_Plane plane 

Instances

Instances details
Bifoldable PlanePlaneIntersection Source # 
Instance details

Defined in HGeometry.HyperPlane.Intersection

Methods

bifold :: Monoid m => PlanePlaneIntersection m m -> m Source #

bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> PlanePlaneIntersection a b -> m Source #

bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> PlanePlaneIntersection a b -> c Source #

bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> PlanePlaneIntersection a b -> c Source #

Bifunctor PlanePlaneIntersection Source # 
Instance details

Defined in HGeometry.HyperPlane.Intersection

Bitraversable PlanePlaneIntersection Source # 
Instance details

Defined in HGeometry.HyperPlane.Intersection

Methods

bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> PlanePlaneIntersection a b -> f (PlanePlaneIntersection c d) Source #

Functor (PlanePlaneIntersection plane) Source # 
Instance details

Defined in HGeometry.HyperPlane.Intersection

Methods

fmap :: (a -> b) -> PlanePlaneIntersection plane a -> PlanePlaneIntersection plane b Source #

(<$) :: a -> PlanePlaneIntersection plane b -> PlanePlaneIntersection plane a Source #

Foldable (PlanePlaneIntersection plane) Source # 
Instance details

Defined in HGeometry.HyperPlane.Intersection

Methods

fold :: Monoid m => PlanePlaneIntersection plane m -> m Source #

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

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

foldr :: (a -> b -> b) -> b -> PlanePlaneIntersection plane a -> b Source #

foldr' :: (a -> b -> b) -> b -> PlanePlaneIntersection plane a -> b Source #

foldl :: (b -> a -> b) -> b -> PlanePlaneIntersection plane a -> b Source #

foldl' :: (b -> a -> b) -> b -> PlanePlaneIntersection plane a -> b Source #

foldr1 :: (a -> a -> a) -> PlanePlaneIntersection plane a -> a Source #

foldl1 :: (a -> a -> a) -> PlanePlaneIntersection plane a -> a Source #

toList :: PlanePlaneIntersection plane a -> [a] Source #

null :: PlanePlaneIntersection plane a -> Bool Source #

length :: PlanePlaneIntersection plane a -> Int Source #

elem :: Eq a => a -> PlanePlaneIntersection plane a -> Bool Source #

maximum :: Ord a => PlanePlaneIntersection plane a -> a Source #

minimum :: Ord a => PlanePlaneIntersection plane a -> a Source #

sum :: Num a => PlanePlaneIntersection plane a -> a Source #

product :: Num a => PlanePlaneIntersection plane a -> a Source #

Traversable (PlanePlaneIntersection plane) Source # 
Instance details

Defined in HGeometry.HyperPlane.Intersection

Methods

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

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

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

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

(Read line, Read plane) => Read (PlanePlaneIntersection plane line) Source # 
Instance details

Defined in HGeometry.HyperPlane.Intersection

(Show line, Show plane) => Show (PlanePlaneIntersection plane line) Source # 
Instance details

Defined in HGeometry.HyperPlane.Intersection

(Eq line, Eq plane) => Eq (PlanePlaneIntersection plane line) Source # 
Instance details

Defined in HGeometry.HyperPlane.Intersection

Methods

(==) :: PlanePlaneIntersection plane line -> PlanePlaneIntersection plane line -> Bool Source #

(/=) :: PlanePlaneIntersection plane line -> PlanePlaneIntersection plane line -> Bool Source #

(Ord line, Ord plane) => Ord (PlanePlaneIntersection plane line) Source # 
Instance details

Defined in HGeometry.HyperPlane.Intersection