| Copyright | (C) Frank Staals |
|---|---|
| License | see the LICENSE file |
| Maintainer | Frank Staals |
| Safe Haskell | None |
| Language | GHC2024 |
HGeometry.Ball.CenterAndRadius
Description
Balls in d-dimensional space, represented by their center and squared radius.
Synopsis
- data Ball point where
- squaredRadius' :: forall point f. Functor f => (NumType point -> f (NumType point)) -> Ball point -> f (Ball point)
- type Disk = Ball
- newtype Sphere point where
- type Circle = Sphere
- _BallSphere :: forall point point' p f. (Profunctor p, Functor f) => p (Sphere point) (f (Sphere point')) -> p (Ball point) (f (Ball point'))
- _DiskCircle :: forall point point' p f. (Profunctor p, Functor f) => p (Circle point) (f (Circle point')) -> p (Disk point) (f (Disk point'))
- fromDiametralPair :: forall r point (d :: Nat). (Fractional r, Point_ point d r, Has_ Metric_ d r) => point -> point -> Ball (Point d r)
- fromCenterAndPoint :: forall r point (d :: Nat) center. (Num r, Point_ point d r, Point_ center d r, Has_ Metric_ d r) => center -> point -> Ball center
- fromBoundaryPoints :: (Point_ point 2 r, Fractional r, Ord r) => Vector 3 point -> Maybe (Disk (Point 2 r))
- data family IntersectionOf g h
Documentation
d-dimensional ball, specified by center and squared radius.
Instances
squaredRadius' :: forall point f. Functor f => (NumType point -> f (NumType point)) -> Ball point -> f (Ball point) Source #
Lens to access the squared radius of a ball
A sphere, i.e. the boudary of a Ball.
Bundled Patterns
| pattern Sphere :: point -> NumType point -> Sphere point | Construct a Sphere; the boundary of a ball |
| pattern Circle :: point -> NumType point -> Circle point | Construct a Circle |
Instances
_BallSphere :: forall point point' p f. (Profunctor p, Functor f) => p (Sphere point) (f (Sphere point')) -> p (Ball point) (f (Ball point')) Source #
Iso to convert between a ball and a sphere.
_DiskCircle :: forall point point' p f. (Profunctor p, Functor f) => p (Circle point) (f (Circle point')) -> p (Disk point) (f (Disk point')) Source #
Iso to convert between a Disk and a Circle
fromDiametralPair :: forall r point (d :: Nat). (Fractional r, Point_ point d r, Has_ Metric_ d r) => point -> point -> Ball (Point d r) Source #
Given two points on the diameter of the ball, construct a ball.
fromCenterAndPoint :: forall r point (d :: Nat) center. (Num r, Point_ point d r, Point_ center d r, Has_ Metric_ d r) => center -> point -> Ball center Source #
Construct a ball given the center point and a point p on the boundary.
fromBoundaryPoints :: (Point_ point 2 r, Fractional r, Ord r) => Vector 3 point -> Maybe (Disk (Point 2 r)) Source #
Tries to create a disk from three points on the boundary.
data family IntersectionOf g h Source #
The data family specifying to help implement the Intersection
type family.
Instances
| (Show r, Has_ Additive_ d r) => Show (IntersectionOf (LinePV d r) (Ball point)) Source # | |
| (Eq r, Eq (Vector d r)) => Eq (IntersectionOf (LinePV d r) (Ball point)) Source # | |
Defined in HGeometry.Ball.CenterAndRadius Methods (==) :: IntersectionOf (LinePV d r) (Ball point) -> IntersectionOf (LinePV d r) (Ball point) -> Bool Source # (/=) :: IntersectionOf (LinePV d r) (Ball point) -> IntersectionOf (LinePV d r) (Ball point) -> Bool Source # | |
| data IntersectionOf (LinePV d r) (Ball point) Source # | The extra value is the parameter t, so that the intersection point is line^.anchroPoint + t*line^.direction |
Defined in HGeometry.Ball.CenterAndRadius data IntersectionOf (LinePV d r) (Ball point)
| |