This is the base class for various coordinate representations. More...
#include <grasp_coordinates.h>
Public Types | |
enum | coord_system_type { cartesian, cylindrical, spherical } |
The three different types of coordinate systems. More... | |
Public Member Functions | |
coordinates () | |
coordinates (vec3 v) | |
coordinates (coordinates *c) | |
coordinates (double a, double b, double c) | |
virtual double | distanceTo (coordinates) const |
virtual coord_system_type | get_coord_system_type () |
virtual cartesian_coordinates | get_pos_cartesian () const |
virtual cylindrical_coordinates | get_pos_cylindrical () const |
virtual spherical_coordinates | get_pos_spherical () const |
virtual cartesian_coordinates | get_vec_cartesian (coordinates from) const |
virtual cylindrical_coordinates | get_vec_cylindrical (coordinates from) const |
virtual spherical_coordinates | get_vec_spherical (coordinates from) const |
bool | operator== (coordinates) |
virtual void | set_coord_system_type (coord_system_type) |
Public Attributes | |
coord_system_type | coord_type |
Holds the type of coordinate representation for this instance. |
This is the base class for various coordinate representations.
It can convert between the various types of coordinate systems.
Definition at line 50 of file grasp_coordinates.h.
The three different types of coordinate systems.
cartesian |
coordinates are x, y, z |
cylindrical |
coordinates are r, phi, z |
spherical |
coordinates are r, theta, phi |
Definition at line 56 of file grasp_coordinates.h.
coordinates::coordinates | ( | double | a, | |
double | b, | |||
double | c | |||
) |
Initializes vec3 class with a , b , c .
Definition at line 50 of file grasp_coordinates.cpp.
coordinates::coordinates | ( | coordinates * | c | ) |
Initializes vec3 class with a copy of the values in c .
Definition at line 57 of file grasp_coordinates.cpp.
coordinates::coordinates | ( | vec3 | v | ) |
Initializes vec3 class by copying the values of v .
Definition at line 64 of file grasp_coordinates.cpp.
coordinates::coordinates | ( | ) |
Initializes vec3 class with 0,0,0.
Definition at line 71 of file grasp_coordinates.cpp.
double coordinates::distanceTo | ( | coordinates | to | ) | const [virtual] |
This is overrided in other sub-classes.
Reimplemented in cartesian_coordinates.
Definition at line 169 of file grasp_coordinates.cpp.
coordinates::coord_system_type coordinates::get_coord_system_type | ( | ) | [virtual] |
Returns the coordinates type.
Definition at line 79 of file grasp_coordinates.cpp.
cartesian_coordinates coordinates::get_pos_cartesian | ( | ) | const [virtual] |
Returns the cartesian coordinates representation of the 3 vector values.
Reimplemented in cartesian_coordinates, cylindrical_coordinates, and spherical_coordinates.
Definition at line 98 of file grasp_coordinates.cpp.
cylindrical_coordinates coordinates::get_pos_cylindrical | ( | ) | const [virtual] |
Returns the cylindrical coordinates representation of the 3 vector values.
Reimplemented in cartesian_coordinates, cylindrical_coordinates, and spherical_coordinates.
Definition at line 107 of file grasp_coordinates.cpp.
spherical_coordinates coordinates::get_pos_spherical | ( | ) | const [virtual] |
Returns the spherical coordinates representation of the 3 vector values.
Reimplemented in cartesian_coordinates, cylindrical_coordinates, and spherical_coordinates.
Definition at line 116 of file grasp_coordinates.cpp.
cartesian_coordinates coordinates::get_vec_cartesian | ( | coordinates | from | ) | const [virtual] |
This is overrided in other sub-classes.
Definition at line 125 of file grasp_coordinates.cpp.
cylindrical_coordinates coordinates::get_vec_cylindrical | ( | coordinates | from | ) | const [virtual] |
This is overrided in other sub-classes.
Definition at line 135 of file grasp_coordinates.cpp.
spherical_coordinates coordinates::get_vec_spherical | ( | coordinates | from | ) | const [virtual] |
This is overrided in other sub-classes.
Definition at line 145 of file grasp_coordinates.cpp.
bool coordinates::operator== | ( | coordinates | c | ) |
Compares this coordinate with c. If their elements are equal then TRUE is returned.
Definition at line 156 of file grasp_coordinates.cpp.
void coordinates::set_coord_system_type | ( | coord_system_type | ct | ) | [virtual] |
Sets the coordinate system type to ct .
Definition at line 89 of file grasp_coordinates.cpp.
Holds the type of coordinate representation for this instance.
Definition at line 63 of file grasp_coordinates.h.