A ball in N dimensional space. More...
#include <Ball.h>
Public Types | |
| typedef T | Number |
| The number type. | |
|
typedef ads::FixedArray< N, Number > | Point |
| The representation of a point. | |
Public Member Functions | |
Constructors etc. | |
| Ball () | |
| Default constructor. Uninitialized memory. | |
| Ball (const Point ¢er, const Number radius) | |
| Construct from a center and radius. | |
| Ball (const Ball &other) | |
| Copy constructor. | |
| Ball & | operator= (const Ball &other) |
| Assignment operator. | |
| ~Ball () | |
| Trivial destructor. | |
| void | make (const Point ¢er, const Number radius) |
| Make from a center and radius. | |
Accesors. | |
| const Point & | getCenter () const |
| Return the center. | |
| Number | getRadius () const |
| Return the radius. | |
Manipulators. | |
| void | setCenter (const Point ¢er) |
| Set the center. | |
| void | setRadius (const Number radius) |
| Set the radius. | |
Translations. | |
| Ball & | operator+= (const Point &x) |
| Translate by p. | |
| Ball & | operator-= (const Point &x) |
| Translate by -p. | |
Mathematical functions. | |
| bool | isInside (const Point &position) const |
| Return true if the point is inside this ball. | |
Related Functions | |
(Note that these are not member functions.) | |
| template<int N, typename T > | |
| bool | operator== (const Ball< N, T > &x, const Ball< N, T > &y) |
| Return true if the balls are equal. | |
| template<int N, typename T > | |
| bool | operator!= (const Ball< N, T > &x, const Ball< N, T > &y) |
| Return true if the balls are not equal. | |
| template<int N, typename T > | |
| Ball< N, T > | operator+ (const Ball< N, T > &b, const typename Ball< N, T >::Point &p) |
| Return a ball translated by p. | |
| template<int N, typename T > | |
| Ball< N, T > | operator- (const Ball< N, T > &b, const typename Ball< N, T >::Point &p) |
| Return a ball translated by -p. | |
| template<int N, typename T > | |
| std::istream & | operator>> (std::istream &in, Ball< N, T > &x) |
| Read a ball. | |
| template<int N, typename T > | |
| std::ostream & | operator<< (std::ostream &out, const Ball< N, T > &x) |
| Write the ball. | |
A ball in N dimensional space.
| N | is the dimension. | |
| T | is the number type. By default it is double. |
A ball is defined by a center and a radius.
| bool operator!= | ( | const Ball< N, T > & | x, | |
| const Ball< N, T > & | y | |||
| ) | [related] |
Return true if the balls are not equal.
| Ball< N, T > operator+ | ( | const Ball< N, T > & | b, | |
| const typename Ball< N, T >::Point & | p | |||
| ) | [related] |
Return a ball translated by p.
References Ball< N, T >::getCenter(), and Ball< N, T >::getRadius().
| Ball< N, T > operator- | ( | const Ball< N, T > & | b, | |
| const typename Ball< N, T >::Point & | p | |||
| ) | [related] |
Return a ball translated by -p.
References Ball< N, T >::getCenter(), and Ball< N, T >::getRadius().
| std::ostream & operator<< | ( | std::ostream & | out, | |
| const Ball< N, T > & | x | |||
| ) | [related] |
Write the ball.
| bool operator== | ( | const Ball< N, T > & | x, | |
| const Ball< N, T > & | y | |||
| ) | [related] |
Return true if the balls are equal.
References Ball< N, T >::getCenter(), and Ball< N, T >::getRadius().
| std::istream & operator>> | ( | std::istream & | in, | |
| Ball< N, T > & | x | |||
| ) | [related] |
Read a ball.
1.6.3