| Copyright | (C) Frank Staals |
|---|---|
| License | see the LICENSE file |
| Maintainer | Frank Staals |
| Safe Haskell | None |
| Language | GHC2024 |
HGeometry.HyperPlane.NonVertical
Description
Non-vertical hyperplanes in d-dimensional space.
Synopsis
- newtype NonVerticalHyperPlane (d :: Nat) r where
- NonVerticalHyperPlane (Vector d r)
- pattern Plane :: r -> r -> r -> Plane r
- 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)
- type Plane = NonVerticalHyperPlane 3
- module HGeometry.HyperPlane.Class
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
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 myOtherLineJust (NonVerticalHyperPlane [-1.5,-2.0])>>>asNonVerticalHyperPlane myPlaneJust (Plane 2.0 3.0 10.0)
type Plane = NonVerticalHyperPlane 3 Source #
Shorthand for non-vertical hyperplanes in R^3
module HGeometry.HyperPlane.Class