34 void setCoords(
const double x,
const double y,
const double z=0.0);
39 void setX(
const double x);
40 void setY(
const double y);
41 void setZ(
const double z);
42 double distance(
const double x,
const double y,
const double z)
const;
145 double deltax = _xyz[0] - x;
146 double deltay = _xyz[1] - y;
147 double deltaz = _xyz[2] - z;
148 return sqrt(deltax*deltax + deltay*deltay + deltaz*deltaz);
158 double deltax = _xyz[0] - point->
getX();
159 double deltay = _xyz[1] - point->
getY();
160 double deltaz = _xyz[2] - point->
getZ();
161 return sqrt(deltax*deltax + deltay*deltay + deltaz*deltaz);
170 _xyz[0] = point->
getX();
171 _xyz[1] = point->
getY();
172 _xyz[2] = point->
getZ();
void setX(const double x)
Set the Point's x-coordinate.
Definition: Point.h:103
void setXYZ(double *xyz)
Set the Point's x, y and z-coordinates.
Definition: Point.h:130
double getY() const
Returns this Point's y-coordinate.
Definition: Point.h:76
Class to represent a 2D/3D point in space.
Definition: Point.h:24
double getX() const
Returns this Point's x-coordinate.
Definition: Point.h:67
void copyCoords(Point *point)
Copy the coordinates from another point.
Definition: Point.h:169
virtual ~Point()
Destructor.
Definition: Point.cpp:17
double distance(const double x, const double y, const double z) const
Compute the distance from this Point to another Point of interest.
Definition: Point.h:144
void setZ(const double z)
Set the Point's z-coordinate.
Definition: Point.h:121
double distanceToPoint(const Point *point)
Compute the distance from this Point to another Point of interest.
Definition: Point.h:157
Point()
Constructor initializes an empty Point.
Definition: Point.cpp:7
double getZ() const
Returns this Point's z-coordinate.
Definition: Point.h:85
void setCoords(const double x, const double y, const double z=0.0)
Initializes a Point with two-dimensional coordinates.
Definition: Point.h:56
void setY(const double y)
Set the Point's y-coordinate.
Definition: Point.h:112
Utility functions for writing log messages to the screen.
std::string toString()
Converts this Point to a character representation of its attributes.
Definition: Point.cpp:27
double * getXYZ()
Returns this Point's coordinates.
Definition: Point.h:94