To store and treat a sphere. More...
Public Member Functions | |
Sphere () | |
Default construcor. | |
Sphere (const Point< real_t > &c, real_t r, int code=1) | |
Constructor. More... | |
void | setRadius (real_t r) |
Assign radius of sphere. | |
real_t | getRadius () const |
Return radius of sphere. | |
void | setCenter (const Point< real_t > &c) |
Assign coordinates of center of sphere. | |
Point< real_t > | getCenter () const |
Return coordinates of center of sphere. | |
real_t | getSignedDistance (const Point< real_t > &p) const |
Return signed distance of a given point from the current sphere. More... | |
Sphere & | operator+= (Point< real_t > a) |
Operator +=. More... | |
Sphere & | operator+= (real_t a) |
Operator *=. More... | |
Public Member Functions inherited from Figure | |
Figure () | |
Default constructor. | |
Figure (const Figure &f) | |
Copy constructor. | |
virtual | ~Figure () |
Destructor. | |
void | setCode (int code) |
Choose a code for the domain defined by the figure. | |
Figure & | operator= (const Figure &f) |
Operator =. | |
void | getSignedDistance (const Grid &g, Vect< real_t > &d) const |
Calculate signed distance to current figure with respect to grid points. More... | |
real_t | dLine (const Point< real_t > &p, const Point< real_t > &a, const Point< real_t > &b) const |
Compute signed distance from a line. More... | |
To store and treat a sphere.
Constructor.
[in] | c | Coordinates of center of sphere |
[in] | r | Radius |
[in] | code | Code to assign to the generated sphere [Default: 1] |
Return signed distance of a given point from the current sphere.
The computed distance is negative if p
lies in the ball, positive if it is outside, and 0 on the sphere
[in] | p | Point<double> instance |
Reimplemented from Figure.