next up previous contents index
Next: Rational Simplices ( d3_rat_simplex Up: Basic Data Types for Previous: Rational Planes ( d3_rat_plane   Contents   Index


Rational Spheres ( d3_rat_sphere )

Definition

An instance of the data type d3_rat_sphere is an oriented sphere in 3d space. The sphere is defined by four points p1,p2,p3,p4 with rational coordinates (d3_rat_points).

#include < LEDA/geo/d3_rat_sphere.h >

Creation

d3_rat_sphere S(const d3_rat_point& p1, const d3_rat_point& p2, const d3_rat_point& p3, const d3_rat_point& p4)
    introduces a variable S of type d3_rat_sphere. S is initialized to the sphere through points p1,p2,p3,p4.

Operations

d3_sphere S.to_float() returns a floating point approximation of S.

bool S.contains(const d3_rat_point& p)
    returns true, if p is on the sphere, false otherwise.

bool S.inside(const d3_rat_point& p)
    returns true, if p is inside the sphere, false otherwise.

bool S.outside(const d3_rat_point& p)
    returns true, if p is outside the sphere, false otherwise.

d3_rat_point S.point1() returns p1.

d3_rat_point S.point2() returns p2.

d3_rat_point S.point3() returns p3.

d3_rat_point S.point4() returns p4.

bool S.is_degenerate() returns true, if the 4 defining points are coplanar.

d3_rat_point S.center() returns the center of the sphere.

rational S.sqr_radius() returns the square of the radius.

d3_rat_sphere S.translate(const rat_vector& v)
    translates the sphere by vector v and returns a new d3_rat_sphere.

d3_rat_sphere S.translate(const rational& r1, const rational& r2, const rational& r3)
    translates the sphere by vector (r1,r2,r3) and returns a new d3_rat_sphere.


next up previous contents index
Next: Rational Simplices ( d3_rat_simplex Up: Basic Data Types for Previous: Rational Planes ( d3_rat_plane   Contents   Index