CGAL::Sphere_3<Kernel>

Definition

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

Creation

Sphere_3<Kernel> c ( Point_3<Kernel> center, Kernel::FT squared_radius, Orientation orientation = COUNTERCLOCKWISE);
introduces a variable c of type Sphere_3<Kernel>. It is initialized to the sphere with center center, squared radius squared_radius and orientation orientation.
Precondition: orientation COPLANAR, and furthermore, squared_radius greater or equal 0.


Sphere_3<Kernel> c ( Point_3<Kernel> p, Point_3<Kernel> q, Point_3<Kernel> r, Point_3<Kernel> s);
introduces a variable c of type Sphere_3<Kernel>. 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<Kernel> c ( Point_3<Kernel> p, Point_3<Kernel> q, Point_3<Kernel> r, Orientation o = COUNTERCLOCKWISE);
introduces a variable c of type Sphere_3<Kernel>. 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<Kernel> c ( Point_3<Kernel> p, Point_3<Kernel> q, Orientation o = COUNTERCLOCKWISE);
introduces a variable c of type Sphere_3<Kernel>. 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<Kernel> c ( Point_3<Kernel> center, Orientation orientation = COUNTERCLOCKWISE);
introduces a variable c of type Sphere_3<Kernel>. It is initialized to the sphere with center center, squared radius zero and orientation orientation.
Precondition: orientation COPLANAR.
Postcondition: c.is_degenerate() = true.


Sphere_3<Kernel> c ( Circle_3<Kernel> c);
introduces a variable c of type Sphere_3<Kernel>. It is initialized to the diametral sphere of the circle.

Access Functions

Point_3<Kernel> c.center () returns the center of c.
Kernel::FT c.squared_radius () returns the squared radius of c.
Orientation c.orientation () returns the orientation of c.

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

bool c.operator != ( sphere2) returns true, iff c and sphere2 are not equal.

Predicates

bool c.is_degenerate () returns true, iff c is degenerate, i.e. if c has squared radius zero.

Oriented_side c.oriented_side ( Point_3<Kernel> p)
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.

Bounded_side c.bounded_side ( Point_3<Kernel> p)
returns ON_BOUNDED_SIDE, ON_BOUNDARY, or ON_UNBOUNDED_SIDE iff p lies properly inside, on the boundary, or properly outside of c, resp.

bool c.has_on_positive_side ( Point_3<Kernel> p)
bool c.has_on_negative_side ( Point_3<Kernel> p)
bool c.has_on_boundary ( Point_3<Kernel> p)
bool c.has_on_bounded_side ( Point_3<Kernel> p)
bool c.has_on_unbounded_side ( Point_3<Kernel> p)

bool c.has_on ( Point_3<Kernel> p)
bool c.has_on ( Circle_3<Kernel> p)

Miscellaneous

Sphere_3<Kernel> c.opposite () returns the sphere with the same center and squared radius as c but with opposite orientation.

Sphere_3<Kernel> c.orthogonal_transform ( Aff_transformation_3<Kernel> at)
returns the sphere obtained by applying at on c.
Precondition: at is an orthogonal transformation.

Bbox_3 c.bbox () returns a bounding box containing c.

See Also

Kernel::Sphere_3