CGAL 5.1 - 2D and 3D Linear Geometry Kernel
CGAL::Sphere_3< Kernel > Class Template Reference

#include <CGAL/Sphere_3.h>

Definition

template<typename Kernel>
class CGAL::Sphere_3< Kernel >

An object of type Sphere_3 is a sphere in the three-dimensional Euclidean space \( \E^3\). The sphere is oriented, i.e. its boundary has clockwise or counterclockwise orientation. The boundary splits \( \E^3\) into a positive and a negative side, where the positive side is to the left of the boundary. The boundary also splits \( \E^3\) into a bounded and an unbounded side. Note that the sphere can be degenerated, i.e. the squared radius may be zero.

Is Model Of:

Kernel::Sphere_3

Hashable if Kernel is a cartesian kernel and if Kernel::FT is Hashable

Creation

 Sphere_3 (const Point_3< Kernel > &center, const Kernel::FT &squared_radius, const Orientation &orientation=COUNTERCLOCKWISE)
 introduces a variable c of type Sphere_3. More...
 
 Sphere_3 (const Point_3< Kernel > &p, const Point_3< Kernel > &q, const Point_3< Kernel > &r, const Point_3< Kernel > &s)
 introduces a variable c of type Sphere_3. More...
 
 Sphere_3 (const Point_3< Kernel > &p, const Point_3< Kernel > &q, const Point_3< Kernel > &r, const Orientation &o=COUNTERCLOCKWISE)
 introduces a variable c of type Sphere_3. More...
 
 Sphere_3 (const Point_3< Kernel > &p, const Point_3< Kernel > &q, const Orientation &o=COUNTERCLOCKWISE)
 introduces a variable c of type Sphere_3. More...
 
 Sphere_3 (const Point_3< Kernel > &center, const Orientation &orientation=COUNTERCLOCKWISE)
 introduces a variable c of type Sphere_3. More...
 
 Sphere_3 (const Circle_3< Kernel > &c)
 introduces a variable c of type Sphere_3. More...
 

Access Functions

const Point_3< Kernel > & center () const
 returns the center of c. More...
 
Kernel::FT const & squared_radius () const
 returns the squared radius of c. More...
 
Orientation const & orientation () const
 returns the orientation of c. More...
 
bool operator== (const Sphere_3< Kernel > &sphere2) const
 returns true, iff c and sphere2 are equal, i.e. if they have the same center, same squared radius and same orientation. More...
 
bool operator!= (const Sphere_3< Kernel > &sphere2) const
 returns true, iff c and sphere2 are not equal. More...
 

Predicates

bool is_degenerate () const
 returns true, iff c is degenerate, i.e. if c has squared radius zero. More...
 
Oriented_side oriented_side (const Point_3< Kernel > &p) const
 returns either the constant ON_ORIENTED_BOUNDARY, ON_POSITIVE_SIDE, or ON_NEGATIVE_SIDE, iff p lies on the boundary, properly on the positive side, or properly on the negative side of c, resp. More...
 
Bounded_side bounded_side (const Point_3< Kernel > &p) const
 returns ON_BOUNDED_SIDE, ON_BOUNDARY, or ON_UNBOUNDED_SIDE iff p lies properly inside, on the boundary, or properly outside of c, resp. More...
 
bool has_on_positive_side (const Point_3< Kernel > &p) const
 
bool has_on_negative_side (const Point_3< Kernel > &p) const
 
bool has_on_boundary (const Point_3< Kernel > &p) const
 
bool has_on_bounded_side (const Point_3< Kernel > &p) const
 
bool has_on_unbounded_side (const Point_3< Kernel > &p) const
 
bool has_on (const Point_3< Kernel > &p) const
 
bool has_on (const Circle_3< Kernel > &p) const
 

Miscellaneous

Sphere_3< Kernelopposite () const
 returns the sphere with the same center and squared radius as c but with opposite orientation. More...
 
Sphere_3< Kernelorthogonal_transform (Aff_transformation_3< Kernel > const &at) const
 returns the sphere obtained by applying at on c. More...
 
Bbox_3 bbox () const
 returns a bounding box containing c. More...
 

Constructor & Destructor Documentation

◆ Sphere_3() [1/6]

template<typename Kernel >
CGAL::Sphere_3< Kernel >::Sphere_3 ( const Point_3< Kernel > &  center,
const Kernel::FT squared_radius,
const Orientation orientation = COUNTERCLOCKWISE 
)

introduces a variable c of type Sphere_3.

It is initialized to the sphere with center center, squared radius squared_radius and orientation orientation.

Precondition
orientation \( \neq\) COPLANAR, and furthermore, squared_radius \( \geq\) 0.

◆ Sphere_3() [2/6]

template<typename Kernel >
CGAL::Sphere_3< Kernel >::Sphere_3 ( const Point_3< Kernel > &  p,
const Point_3< Kernel > &  q,
const Point_3< Kernel > &  r,
const Point_3< Kernel > &  s 
)

introduces a variable c of type Sphere_3.

It is initialized to the unique sphere which passes through the points p, q, r and s. The orientation of the sphere is the orientation of the point quadruple p, q, r, s.

Precondition
p, q, r, and s are not coplanar.

◆ Sphere_3() [3/6]

template<typename Kernel >
CGAL::Sphere_3< Kernel >::Sphere_3 ( const Point_3< Kernel > &  p,
const Point_3< Kernel > &  q,
const Point_3< Kernel > &  r,
const Orientation o = COUNTERCLOCKWISE 
)

introduces a variable c of type Sphere_3.

It is initialized to the smallest sphere which passes through the points p, q, and r. The orientation of the sphere is o.

Precondition
o is not COPLANAR.

◆ Sphere_3() [4/6]

template<typename Kernel >
CGAL::Sphere_3< Kernel >::Sphere_3 ( const Point_3< Kernel > &  p,
const Point_3< Kernel > &  q,
const Orientation o = COUNTERCLOCKWISE 
)

introduces a variable c of type Sphere_3.

It is initialized to the smallest sphere which passes through the points p and q. The orientation of the sphere is o.

Precondition
o is not COPLANAR.

◆ Sphere_3() [5/6]

template<typename Kernel >
CGAL::Sphere_3< Kernel >::Sphere_3 ( const Point_3< Kernel > &  center,
const Orientation orientation = COUNTERCLOCKWISE 
)

introduces a variable c of type Sphere_3.

It is initialized to the sphere with center center, squared radius zero and orientation orientation.

Precondition
orientation \( \neq\) COPLANAR.
Postcondition
c.is_degenerate() = true.

◆ Sphere_3() [6/6]

template<typename Kernel >
CGAL::Sphere_3< Kernel >::Sphere_3 ( const Circle_3< Kernel > &  c)

introduces a variable c of type Sphere_3.

It is initialized to the diametral sphere of the circle.

Member Function Documentation

◆ bbox()

template<typename Kernel >
Bbox_3 CGAL::Sphere_3< Kernel >::bbox ( ) const

returns a bounding box containing c.

◆ bounded_side()

template<typename Kernel >
Bounded_side CGAL::Sphere_3< Kernel >::bounded_side ( const Point_3< Kernel > &  p) const

returns ON_BOUNDED_SIDE, ON_BOUNDARY, or ON_UNBOUNDED_SIDE iff p lies properly inside, on the boundary, or properly outside of c, resp.

◆ center()

template<typename Kernel >
const Point_3<Kernel>& CGAL::Sphere_3< Kernel >::center ( ) const

returns the center of c.

◆ has_on() [1/2]

template<typename Kernel >
bool CGAL::Sphere_3< Kernel >::has_on ( const Circle_3< Kernel > &  p) const

◆ has_on() [2/2]

template<typename Kernel >
bool CGAL::Sphere_3< Kernel >::has_on ( const Point_3< Kernel > &  p) const

◆ has_on_boundary()

template<typename Kernel >
bool CGAL::Sphere_3< Kernel >::has_on_boundary ( const Point_3< Kernel > &  p) const

◆ has_on_bounded_side()

template<typename Kernel >
bool CGAL::Sphere_3< Kernel >::has_on_bounded_side ( const Point_3< Kernel > &  p) const

◆ has_on_negative_side()

template<typename Kernel >
bool CGAL::Sphere_3< Kernel >::has_on_negative_side ( const Point_3< Kernel > &  p) const

◆ has_on_positive_side()

template<typename Kernel >
bool CGAL::Sphere_3< Kernel >::has_on_positive_side ( const Point_3< Kernel > &  p) const

◆ has_on_unbounded_side()

template<typename Kernel >
bool CGAL::Sphere_3< Kernel >::has_on_unbounded_side ( const Point_3< Kernel > &  p) const

◆ is_degenerate()

template<typename Kernel >
bool CGAL::Sphere_3< Kernel >::is_degenerate ( ) const

returns true, iff c is degenerate, i.e. if c has squared radius zero.

◆ operator!=()

template<typename Kernel >
bool CGAL::Sphere_3< Kernel >::operator!= ( const Sphere_3< Kernel > &  sphere2) const

returns true, iff c and sphere2 are not equal.

◆ operator==()

template<typename Kernel >
bool CGAL::Sphere_3< Kernel >::operator== ( const Sphere_3< Kernel > &  sphere2) const

returns true, iff c and sphere2 are equal, i.e. if they have the same center, same squared radius and same orientation.

◆ opposite()

template<typename Kernel >
Sphere_3<Kernel> CGAL::Sphere_3< Kernel >::opposite ( ) const

returns the sphere with the same center and squared radius as c but with opposite orientation.

◆ orientation()

template<typename Kernel >
Orientation const& CGAL::Sphere_3< Kernel >::orientation ( ) const

returns the orientation of c.

◆ oriented_side()

template<typename Kernel >
Oriented_side CGAL::Sphere_3< Kernel >::oriented_side ( const Point_3< Kernel > &  p) const

returns either the constant ON_ORIENTED_BOUNDARY, ON_POSITIVE_SIDE, or ON_NEGATIVE_SIDE, iff p lies on the boundary, properly on the positive side, or properly on the negative side of c, resp.

◆ orthogonal_transform()

template<typename Kernel >
Sphere_3<Kernel> CGAL::Sphere_3< Kernel >::orthogonal_transform ( Aff_transformation_3< Kernel > const &  at) const

returns the sphere obtained by applying at on c.

Precondition
at is an orthogonal transformation.

◆ squared_radius()

template<typename Kernel >
Kernel::FT const& CGAL::Sphere_3< Kernel >::squared_radius ( ) const

returns the squared radius of c.