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_VALUES(Name, PluralName)
Define the type for storing sets of values.
#define IMP_SHOWABLE_INLINE(Name, how_to_show)
Declare the methods needed by an object that can be printed.
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
SphericalVector3D(const Vector3D &v)
SphericalVector3D(double r, double theta, double psi, bool apply_check=true)
Various useful constants.
Exception definitions and assertions.
Class to represent a 3D point in spherical coordinates.
Various general useful macros for IMP.
std::string String
Basic string value.
An exception for an invalid value being passed to IMP.