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

HGeometry.Ball.CenterAndRadius

Description

Balls in d-dimensional space, represented by their center and squared radius.

Synopsis

Documentation

data Ball point Source #

d-dimensional ball, specified by center and squared radius.

Constructors

Ball !point !(NumType point) 

Bundled Patterns

pattern Disk :: point -> NumType point -> Disk point

Construct a disk

Instances

Instances details
(Show point, Show (NumType point)) => Show (Ball point) Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

Methods

showsPrec :: Int -> Ball point -> ShowS Source #

show :: Ball point -> String Source #

showList :: [Ball point] -> ShowS Source #

(Eq point, Eq (NumType point)) => Eq (Ball point) Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

Methods

(==) :: Ball point -> Ball point -> Bool Source #

(/=) :: Ball point -> Ball point -> Bool Source #

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

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

Defined in HGeometry.Ball.CenterAndRadius

HasCenter (Ball point) point Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

Methods

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

Point_ center d r => CanComputeNormalVector (Ball center) r Source # 
Instance details

Defined in HGeometry.Direction

Methods

normalUnitVectorAt :: forall point (d0 :: Nat). (Point_ point d0 r, Has_ Metric_ d0 r, d0 ~ Dimension (Ball center), Radical r, Fractional r) => point -> Ball center -> Vector d0 r Source #

normalVectorAt :: forall point (d0 :: Nat). (Point_ point d0 r, d0 ~ Dimension (Ball center), Num r) => point -> Ball center -> Vector d0 r Source #

(Point_ point d r, Point_ point' d r, Ord r, Fractional r, Has_ Metric_ d r, HasSquaredEuclideanDistance point', MkHyperPlaneConstraints d r) => HasIntersectionWith (HalfLine point') (Ball point) Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

Methods

intersects :: HalfLine point' -> Ball point -> Bool Source #

(Point_ point d r, Point_ point' d r, Ord r, Fractional r, Has_ Metric_ d r, HasSquaredEuclideanDistance point', MkHyperPlaneConstraints d r) => HasIntersectionWith (ClosedLineSegment point') (Ball point) Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

Methods

intersects :: ClosedLineSegment point' -> Ball point -> Bool Source #

(Point_ point d r, Point_ point' d r, Ord r, Fractional r, Radical r, Has_ Metric_ d r, MkHyperPlaneConstraints d r, HasSquaredEuclideanDistance point') => IsIntersectableWith (HalfLine point') (Ball point) Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

Methods

intersect :: HalfLine point' -> Ball point -> Intersection (HalfLine point') (Ball point) Source #

(Show r, Has_ Additive_ d r) => Show (IntersectionOf (LinePV d r) (Ball point)) Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

Methods

showsPrec :: Int -> IntersectionOf (LinePV d r) (Ball point) -> ShowS Source #

show :: IntersectionOf (LinePV d r) (Ball point) -> String Source #

showList :: [IntersectionOf (LinePV d r) (Ball point)] -> ShowS Source #

(Eq r, Eq (Vector d r)) => Eq (IntersectionOf (LinePV d r) (Ball point)) Source # 
Instance details

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 #

(Point_ point d r, Ord r, Fractional r, Has_ Metric_ d r) => HasIntersectionWith (LinePV d r) (Ball point) Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

Methods

intersects :: LinePV d r -> Ball point -> Bool Source #

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

Defined in HGeometry.Ball.CenterAndRadius

Methods

intersects :: Point d r -> Ball point -> Bool Source #

(Point_ point d r, Ord r, Fractional r, Radical r, Has_ Metric_ d r) => IsIntersectableWith (LinePV d r) (Ball point) Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

Methods

intersect :: LinePV d r -> Ball point -> Intersection (LinePV d r) (Ball point) Source #

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

Defined in HGeometry.Ball.CenterAndRadius

Methods

intersect :: Point d r -> Ball point -> Intersection (Point d r) (Ball point) Source #

type Dimension (Ball point) Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

type Dimension (Ball point) = Dimension point
type NumType (Ball point) Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

type NumType (Ball point) = NumType point
type Intersection (HalfLine point') (Ball point) Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

type Intersection (HalfLine point') (Ball point) = Maybe (IntersectionOf (LinePV (Dimension point) (NumType point)) (Ball point))
type Intersection (ClosedLineSegment point') (Ball point) Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

type Intersection (ClosedLineSegment point') (Ball point) = Maybe (IntersectionOf (LinePV (Dimension point) (NumType point)) (Ball point))
type Intersection (LinePV d r) (Ball point) Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

type Intersection (LinePV d r) (Ball point) = Maybe (IntersectionOf (LinePV d r) (Ball point))
type Intersection (Point d r) (Ball point) Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

type Intersection (Point d r) (Ball point) = Maybe (Point d r)
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

Instance details

Defined in HGeometry.Ball.CenterAndRadius

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

type Disk = Ball Source #

Balls in 2D are also known as Disks

newtype Sphere point Source #

A sphere, i.e. the boudary of a Ball.

Constructors

MkSphere (Ball point) 

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

Instances details
(Show point, Show (NumType point)) => Show (Sphere point) Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

Methods

showsPrec :: Int -> Sphere point -> ShowS Source #

show :: Sphere point -> String Source #

showList :: [Sphere point] -> ShowS Source #

(Eq point, Eq (NumType point)) => Eq (Sphere point) Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

Methods

(==) :: Sphere point -> Sphere point -> Bool Source #

(/=) :: Sphere point -> Sphere point -> Bool Source #

HasCenter (Sphere point) point Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

Methods

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

(Point_ point d r, Point_ point' d r, Ord r, Fractional r, Has_ Metric_ d r, HasSquaredEuclideanDistance point') => HasIntersectionWith (ClosedLineSegment point') (Sphere point) Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

Methods

intersects :: ClosedLineSegment point' -> Sphere point -> Bool Source #

(Point_ point d r, Eq r, Num r, Has_ Metric_ d r) => HasIntersectionWith (Point d r) (Sphere point) Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

Methods

intersects :: Point d r -> Sphere point -> Bool Source #

(Point_ point d r, Eq r, Num r, Has_ Metric_ d r) => IsIntersectableWith (Point d r) (Sphere point) Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

Methods

intersect :: Point d r -> Sphere point -> Intersection (Point d r) (Sphere point) Source #

type Dimension (Sphere point) Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

type Dimension (Sphere point) = Dimension point
type NumType (Sphere point) Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

type NumType (Sphere point) = NumType point
type Intersection (Point d r) (Sphere point) Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

type Intersection (Point d r) (Sphere point) = Maybe (Point d r)

type Circle = Sphere Source #

A circle, i.e. the boundary of a Disk

_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

Instances details
(Show r, Has_ Additive_ d r) => Show (IntersectionOf (LinePV d r) (Ball point)) Source # 
Instance details

Defined in HGeometry.Ball.CenterAndRadius

Methods

showsPrec :: Int -> IntersectionOf (LinePV d r) (Ball point) -> ShowS Source #

show :: IntersectionOf (LinePV d r) (Ball point) -> String Source #

showList :: [IntersectionOf (LinePV d r) (Ball point)] -> ShowS Source #

(Eq r, Eq (Vector d r)) => Eq (IntersectionOf (LinePV d r) (Ball point)) Source # 
Instance details

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

Instance details

Defined in HGeometry.Ball.CenterAndRadius