| Copyright | (C) Frank Staals |
|---|---|
| License | see the LICENSE file |
| Maintainer | Frank Staals |
| Safe Haskell | None |
| Language | GHC2024 |
HGeometry.HyperPlane
Description
Hyperplanes in \(d\)-dimensional space.
Synopsis
- module HGeometry.HyperPlane.Class
- newtype HyperPlane (d :: Natural) r where
- HyperPlane (Vector (d + 1) r)
- pattern HyperPlane2 :: r -> r -> r -> HyperPlane 2 r
- pattern HyperPlane3 :: r -> r -> r -> r -> HyperPlane 3 r
- 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))
- 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
- module HGeometry.HyperPlane.NonVertical
- data PlanePlaneIntersection plane line
- = Plane_x_Plane_Line line
- | Plane_x_Plane_Plane plane
Documentation
module HGeometry.HyperPlane.Class
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
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
| Bifoldable PlanePlaneIntersection Source # | |
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 # | |
Defined in HGeometry.HyperPlane.Intersection Methods bimap :: (a -> b) -> (c -> d) -> PlanePlaneIntersection a c -> PlanePlaneIntersection b d Source # first :: (a -> b) -> PlanePlaneIntersection a c -> PlanePlaneIntersection b c Source # second :: (b -> c) -> PlanePlaneIntersection a b -> PlanePlaneIntersection a c Source # | |
| Bitraversable PlanePlaneIntersection Source # | |
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 # | |
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 # | |
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 # | |
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 # | |
Defined in HGeometry.HyperPlane.Intersection Methods readsPrec :: Int -> ReadS (PlanePlaneIntersection plane line) Source # readList :: ReadS [PlanePlaneIntersection plane line] Source # readPrec :: ReadPrec (PlanePlaneIntersection plane line) Source # readListPrec :: ReadPrec [PlanePlaneIntersection plane line] Source # | |
| (Show line, Show plane) => Show (PlanePlaneIntersection plane line) Source # | |
Defined in HGeometry.HyperPlane.Intersection | |
| (Eq line, Eq plane) => Eq (PlanePlaneIntersection plane line) Source # | |
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 # | |
Defined in HGeometry.HyperPlane.Intersection Methods compare :: PlanePlaneIntersection plane line -> PlanePlaneIntersection plane line -> Ordering Source # (<) :: PlanePlaneIntersection plane line -> PlanePlaneIntersection plane line -> Bool Source # (<=) :: PlanePlaneIntersection plane line -> PlanePlaneIntersection plane line -> Bool Source # (>) :: PlanePlaneIntersection plane line -> PlanePlaneIntersection plane line -> Bool Source # (>=) :: PlanePlaneIntersection plane line -> PlanePlaneIntersection plane line -> Bool Source # max :: PlanePlaneIntersection plane line -> PlanePlaneIntersection plane line -> PlanePlaneIntersection plane line Source # min :: PlanePlaneIntersection plane line -> PlanePlaneIntersection plane line -> PlanePlaneIntersection plane line Source # | |