Copyright | (C) Frank Staals |
---|---|
License | see the LICENSE file |
Maintainer | Frank Staals |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
Non-vertical hyperplanes in d-dimensional space.
Synopsis
- newtype NonVerticalHyperPlane d r where
- NonVerticalHyperPlane (Vector d r)
- pattern Plane :: r -> r -> r -> Plane r
- asNonVerticalHyperPlane :: (HyperPlane_ hyperPlane d r, Fractional r, Eq r, 1 <= d) => hyperPlane -> Maybe (NonVerticalHyperPlane d r)
- type Plane = NonVerticalHyperPlane 3
- type Plane_ plane = NonVerticalHyperPlane_ plane 3
- pattern Plane_ :: Plane_ plane r => r -> r -> r -> plane
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
NonVerticalHyperPlane (Vector d r) |
Instances
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