8 #ifndef IMPALGEBRA_SPHERICAL_VECTOR_3D_H
9 #define IMPALGEBRA_SPHERICAL_VECTOR_3D_H
11 #include <IMP/algebra/algebra_config.h>
19 IMPALGEBRA_BEGIN_NAMESPACE
30 bool check(
double r,
double theta,
double psi);
45 bool apply_check =
true) {
47 if (!check(r, theta, psi)) {
48 String msg =
"SphericalCoords:: wrong SphericalCoords coordinates.";
57 double operator[](
unsigned int i)
const {
58 IMP_USAGE_CHECK(i < 3,
"Invalid component of SphericalCoords requested: "
63 double& operator[](
unsigned int i) {
64 IMP_USAGE_CHECK(i < 3,
"Invalid component of SphericalCoords requested: "
70 Vector3D get_cartesian_coordinates();
76 void set_cartesian_coordinates(
const Vector3D& v);
82 IMPALGEBRA_END_NAMESPACE
#define IMP_SHOWABLE_INLINE(Name, how_to_show)
Declare the methods needed by an object that can be printed.
Exception definitions and assertions.
SphericalVector3D(const Vector3D &v)
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
Base class for geometric types.
SphericalVector3D(double r, double theta, double psi, bool apply_check=true)
Various useful constants.
Class to represent a 3D point in spherical coordinates.
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
An exception for an invalid value being passed to IMP.
std::string String
Basic string value.
Various general useful macros for IMP.