Next: Simplices in 3D-Space ( Up: Basic Data Types for Previous: Planes ( d3_plane )   Contents   Index

# Spheres in 3D-Space ( d3_sphere )

Definition

An instance of the data type d3_sphere is an oriented sphere in 3d space. The sphere is defined by four points p1,p2,p3,p4 (d3_points).

#include < LEDA/geo/d3_sphere.h >

Creation

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

Operations

 bool S.contains(const d3_point& p) returns true, if p is on the sphere, false otherwise. bool S.inside(const d3_point& p) returns true, if p is inside the sphere, false otherwise. bool S.outside(const d3_point& p) returns true, if p is outside the sphere, false otherwise. d3_point S.point1() returns p1. d3_point S.point2() returns p2. d3_point S.point3() returns p3. d3_point S.point4() returns p4. bool S.is_degenerate() returns true, if the 4 defining points are coplanar. d3_point S.center() returns the center of the sphere. double S.sqr_radius() returns the square of the radius. double S.radius() returns the radius. double S.surface() returns the size of the surface. double S.volume() returns the volume of the sphere. d3_sphere S.translate(const vector& v) returns S translated by vector v. d3_sphere S.translate(double dx, double dy, double dz) returns S translated by vector (dx,dy,dz).

Next: Simplices in 3D-Space ( Up: Basic Data Types for Previous: Planes ( d3_plane )   Contents   Index