| Copyright | (C) Frank Staals |
|---|---|
| License | see the LICENSE file |
| Maintainer | Frank Staals |
| Safe Haskell | None |
| Language | GHC2024 |
HGeometry.Ball.Class
Description
A class of types that can act as balls in \(d\)-dimensional space.
Synopsis
- class (HasCenter ball point, NumType ball ~ NumType point, Point_ point (Dimension ball) (NumType ball)) => Ball_ ball point | ball -> point where
- squaredRadius :: Getter ball (NumType ball)
- class Ball_ ball point => ConstructableBall_ ball point where
- fromCenterAndSquaredRadius :: point -> NumType ball -> ball
- unitBall :: forall r (d :: Nat). (r ~ NumType ball, d ~ Dimension ball, Num r, ConstructablePoint_ point d r) => ball
- pattern Ball_ :: ConstructableBall_ ball point => point -> NumType ball -> ball
- class HasCenter geom point | geom -> point where
- radius :: (Radical r, Ball_ ball point, NumType ball ~ r) => ball -> r
- class (Ball_ disk point, Dimension disk ~ 2) => Disk_ disk point
- pattern Disk_ :: (Disk_ ball point, ConstructableBall_ ball point) => point -> NumType ball -> ball
- class HasInBall ball where
- inDisk :: (Point_ point 2 r, HasInBall disk, Ord r, Num r, Dimension disk ~ 2, NumType disk ~ r) => point -> disk -> PointLocationResult
Documentation
class (HasCenter ball point, NumType ball ~ NumType point, Point_ point (Dimension ball) (NumType ball)) => Ball_ ball point | ball -> point where Source #
Balls in d-dimensional space
Methods
squaredRadius :: Getter ball (NumType ball) Source #
Getter to access the squared radius of a ball
Instances
| Point_ point (Dimension point) (NumType point) => Ball_ (Ball point) point Source # | |
Defined in HGeometry.Ball.CenterAndRadius | |
| (Point_ point d r, Fractional r, Has_ Metric_ d r) => Ball_ (DiametralBall point) (Point d r) Source # | |
Defined in HGeometry.Ball.Diametral Methods squaredRadius :: Getter (DiametralBall point) (NumType (DiametralBall point)) Source # | |
| (Point_ point 2 r, Fractional r) => Ball_ (DiskByPoints point) (Point 2 r) Source # | |
Defined in HGeometry.Disk Methods squaredRadius :: Getter (DiskByPoints point) (NumType (DiskByPoints point)) Source # | |
| (Point_ point d r, Fractional r, 0 <= (k - 1), Has_ Vector_ k point, Has_ Metric_ d r, HasCenter (BallByPoints' k point) (Point d r)) => Ball_ (BallByPoints' k point) (Point d r) Source # | |
Defined in HGeometry.Ball.BoundaryPoints Methods squaredRadius :: Getter (BallByPoints' k point) (NumType (BallByPoints' k point)) Source # | |
class Ball_ ball point => ConstructableBall_ ball point where Source #
Minimal complete definition
Methods
fromCenterAndSquaredRadius :: point -> NumType ball -> ball Source #
Construct a ball from the center and *squared* radius
unitBall :: forall r (d :: Nat). (r ~ NumType ball, d ~ Dimension ball, Num r, ConstructablePoint_ point d r) => ball Source #
A d dimensional unit ball centered at the origin.
pattern Ball_ :: ConstructableBall_ ball point => point -> NumType ball -> ball Source #
Constructs a Ball from its center and squared radius.
class HasCenter geom point | geom -> point where Source #
Types that have a center field lens
Instances
| HasCenter (Ball point) point Source # | |
| HasCenter (Sphere point) point Source # | |
| (Point_ point d r, Fractional r) => HasCenter (DiametralBall point) (Point d r) Source # | |
Defined in HGeometry.Ball.Diametral | |
| (Point_ point 2 r, Fractional r) => HasCenter (DiskByPoints point) (Point 2 r) Source # | |
Defined in HGeometry.Disk | |
| (Point_ point 2 r, Fractional r) => HasCenter (BallByPoints' 3 point) (Point 2 r) Source # | |
Defined in HGeometry.Ball.BoundaryPoints | |
radius :: (Radical r, Ball_ ball point, NumType ball ~ r) => ball -> r Source #
A lens to get/set the radius of a Ball
class (Ball_ disk point, Dimension disk ~ 2) => Disk_ disk point Source #
Disks are two dimensional balls
pattern Disk_ :: (Disk_ ball point, ConstructableBall_ ball point) => point -> NumType ball -> ball Source #
Constructs a Disk by its center and squared radius.
class HasInBall ball where Source #
Class for types that have an "in ball" test.
Methods
inBall :: forall point (d :: Nat) r. (Point_ point d r, Ord r, Num r, NumType ball ~ r, Dimension ball ~ d) => point -> ball -> PointLocationResult Source #
Test if a query point lies inside or outside of a ball.