hgeometry-kernel
Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellNone
LanguageGHC2024

HGeometry.Ball.Class

Description

A class of types that can act as balls in \(d\)-dimensional space.

Synopsis

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

Instances details
Point_ point (Dimension point) (NumType point) => Ball_ (Ball point) point Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

Methods

squaredRadius :: Getter (Ball point) (NumType (Ball point)) Source #

(Point_ point d r, Fractional r, Has_ Metric_ d r) => Ball_ (DiametralBall point) (Point d r) Source # 
Instance details

Defined in HGeometry.Ball.Diametral

(Point_ point 2 r, Fractional r) => Ball_ (DiskByPoints point) (Point 2 r) Source # 
Instance details

Defined in HGeometry.Disk

(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 # 
Instance details

Defined in HGeometry.Ball.BoundaryPoints

class Ball_ ball point => ConstructableBall_ ball point where Source #

Minimal complete definition

fromCenterAndSquaredRadius

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.

Instances

Instances details
Point_ point (Dimension point) (NumType point) => ConstructableBall_ (Ball point) point Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

Methods

fromCenterAndSquaredRadius :: point -> NumType (Ball point) -> Ball point Source #

unitBall :: forall r (d :: Nat). (r ~ NumType (Ball point), d ~ Dimension (Ball point), Num r, ConstructablePoint_ point d r) => Ball point Source #

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

Methods

center :: Lens' geom point Source #

Lens to access the center point of a geometry

Instances

Instances details
HasCenter (Ball point) point Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

Methods

center :: Lens' (Ball point) point Source #

HasCenter (Sphere point) point Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

Methods

center :: Lens' (Sphere point) point Source #

(Point_ point d r, Fractional r) => HasCenter (DiametralBall point) (Point d r) Source # 
Instance details

Defined in HGeometry.Ball.Diametral

Methods

center :: Lens' (DiametralBall point) (Point d r) Source #

(Point_ point 2 r, Fractional r) => HasCenter (DiskByPoints point) (Point 2 r) Source # 
Instance details

Defined in HGeometry.Disk

Methods

center :: Lens' (DiskByPoints point) (Point 2 r) Source #

(Point_ point 2 r, Fractional r) => HasCenter (BallByPoints' 3 point) (Point 2 r) Source # 
Instance details

Defined in HGeometry.Ball.BoundaryPoints

Methods

center :: Lens' (BallByPoints' 3 point) (Point 2 r) Source #

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

Instances

Instances details
Point_ point 2 (NumType point) => Disk_ (Ball point) point Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

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.

Instances

Instances details
(Point_ point d r, Ord r, Num r, Has_ Metric_ d r) => HasInBall (Ball point) Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

Methods

inBall :: forall point0 (d0 :: Nat) r0. (Point_ point0 d0 r0, Ord r0, Num r0, NumType (Ball point) ~ r0, Dimension (Ball point) ~ d0) => point0 -> Ball point -> PointLocationResult Source #

(Point_ point d r, Has_ Metric_ d r) => HasInBall (DiametralBall point) Source # 
Instance details

Defined in HGeometry.Ball.Diametral

Methods

inBall :: forall point0 (d0 :: Nat) r0. (Point_ point0 d0 r0, Ord r0, Num r0, NumType (DiametralBall point) ~ r0, Dimension (DiametralBall point) ~ d0) => point0 -> DiametralBall point -> PointLocationResult Source #

Point_ point 2 r => HasInBall (DiskByPoints point) Source # 
Instance details

Defined in HGeometry.Disk

Methods

inBall :: forall point0 (d :: Nat) r0. (Point_ point0 d r0, Ord r0, Num r0, NumType (DiskByPoints point) ~ r0, Dimension (DiskByPoints point) ~ d) => point0 -> DiskByPoints point -> PointLocationResult Source #

Point_ point 2 r => HasInBall (BallByPoints' 3 point) Source # 
Instance details

Defined in HGeometry.Ball.BoundaryPoints

Methods

inBall :: forall point0 (d :: Nat) r0. (Point_ point0 d r0, Ord r0, Num r0, NumType (BallByPoints' 3 point) ~ r0, Dimension (BallByPoints' 3 point) ~ d) => point0 -> BallByPoints' 3 point -> PointLocationResult Source #

inDisk :: (Point_ point 2 r, HasInBall disk, Ord r, Num r, Dimension disk ~ 2, NumType disk ~ r) => point -> disk -> PointLocationResult Source #

In Disk test