public

Inheritance Graph

graph BT
	_Sphere
	click _Sphere "classGeometry_1_1__Sphere"

Description

Representation of a sphere in three-dimensional space. The sphere is stored as the three-dimensional position of its center and its radius.

Author: Benjamin Eikel

Date: 2011-10-14

Construction

   
   
  _Sphere()
Construct a unit sphere centered at the origin.
   
  _Sphere( vec3_t _center, value_t _radius)
Construct a sphere with the given center and radius.

Information

   
   
const vec3_t & getCenter() const
   
value_t getRadius() const
   
bool isValid() const
   
bool operator==(const _Sphere < value_t > & other) const
   
value_t distance(const vec3_t & position) const
   
bool isOutside(const vec3_t & position) const
   
vec3_t calcCartesianCoordinate( value_t inclination, value_t azimuth) const
   
vec3_t calcCartesianCoordinateUnitSphere( value_t inclination, value_t azimuth)

Modification

   
   
void setCenter(const vec3_t & _center)
   
void setRadius( value_t _radius)
   
_Sphere & include(const vec3_t & position)
Change the sphere such that it contains its old volume and additionally the given position.
   
_Sphere & include(const _Sphere & other)
Change the sphere such that it contains its old volume and additionally the given sphere.

Serialization

 
 
 

Public Types

   
   
typedef T_ value_t
   
typedef _Vec3 < value_t > vec3_t

Documentation

function
Geometry::_Sphere::_Sphere

public inline
   
   
_Sphere( )

Construct a unit sphere centered at the origin.

Defined in Geometry/Sphere.h:42


function
Geometry::_Sphere::_Sphere

public inline
     
     
_Sphere( vec3_t _center,
  value_t _radius
)    

Construct a sphere with the given center and radius.

Defined in Geometry/Sphere.h:46


function
Geometry::_Sphere::getCenter

public const inline
   
   
const vec3_t & getCenter( ) const

Defined in Geometry/Sphere.h:52


function
Geometry::_Sphere::getRadius

public const inline
   
   
value_t getRadius( ) const

Defined in Geometry/Sphere.h:55


function
Geometry::_Sphere::isValid

public const inline
   
   
bool isValid( ) const

Defined in Geometry/Sphere.h:58


function
Geometry::_Sphere::operator==

public const inline
     
     
bool operator==( const _Sphere < value_t > & other ) const

Defined in Geometry/Sphere.h:61


function
Geometry::_Sphere::distance

public const inline
     
     
value_t distance( const vec3_t & position ) const

Calculate the distance of the given position to the sphere.

Parameters

position
Position vector

Parameters

>0
The position is outside the sphere.
0
The position is on the surface of the sphere.
<0
The position is inside the sphere.

Defined in Geometry/Sphere.h:72


function
Geometry::_Sphere::isOutside

public const inline
     
     
bool isOutside( const vec3_t & position ) const

Check if the given position is outside the sphere.

Parameters

position
Position vector

Parameters

true
The position is outside the sphere.
false
The position is inside the sphere, or on the surface of the sphere

Defined in Geometry/Sphere.h:82


function
Geometry::_Sphere::calcCartesianCoordinate

public const inline
     
     
vec3_t calcCartesianCoordinate( value_t inclination,
  value_t azimuth
) const    

Convert a position on this sphere given in spherical coordinates into Cartesian coordinates. The functioncalcCartesianCoordinateUnitSphereis called, and center and radius of this sphere are applied to the result.

See also: calcCartesianCoordinateUnitSphere

Defined in Geometry/Sphere.h:93


function
Geometry::_Sphere::calcCartesianCoordinateUnitSphere

public static inline
     
     
vec3_t calcCartesianCoordinateUnitSphere( value_t inclination,
  value_t azimuth
)    

Convert a position on the unit sphere given in spherical coordinates into Cartesian coordinates. The unit sphere is centered at the origin.

Parameters

inclination
Inclination angle from [0, PI]
azimuth
Azimuth angle from [0, 2 * PI)

Returns

Three-dimensional vector representing a position on the unit sphere

Note: Aninclinationof zero corresponds to the north pole (0, 1, 0), independent of the azimuth.

Note: Aninclinationof PI corresponds to the south pole (0, -1, 0), independent of the azimuth.

Note: Aninclinationof PI/2 andazimuthof zero corresponds to the vector (1, 0, 0).

Note: Aninclinationof PI/2 andazimuthof 1/2 * PI corresponds to the vector (0, 0, 1).

Note: Aninclinationof PI/2 andazimuthof PI corresponds to the vector (-1, 0, 0).

Note: Aninclinationof PI/2 andazimuthof 3/2 * PI corresponds to the vector (0, 0, -1).

Defined in Geometry/Sphere.h:111


function
Geometry::_Sphere::setCenter

public inline
     
     
void setCenter( const vec3_t & _center )

Defined in Geometry/Sphere.h:120


function
Geometry::_Sphere::setRadius

public inline
     
     
void setRadius( value_t _radius )

Defined in Geometry/Sphere.h:123


function
Geometry::_Sphere::include

public inline
     
     
_Sphere & include( const vec3_t & position )

Change the sphere such that it contains its old volume and additionally the given position.

Defined in Geometry/Sphere.h:128


function
Geometry::_Sphere::include

public inline
     
     
_Sphere & include( const _Sphere & other )

Change the sphere such that it contains its old volume and additionally the given sphere.

Defined in Geometry/Sphere.h:152


typedef
Geometry::_Sphere::value_t

public
 
 
typedef T_ value_t

Defined in Geometry/Sphere.h:31


typedef
Geometry::_Sphere::vec3_t

public
 
 
typedef _Vec3 < value_t > vec3_t

Defined in Geometry/Sphere.h:32