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);
43 bool apply_check =
true) {
45 if (!check(r, theta, psi)) {
46 String msg =
"SphericalCoords:: wrong SphericalCoords coordinates.";
55 double operator[](
unsigned int i)
const {
56 IMP_USAGE_CHECK(i < 3,
"Invalid component of SphericalCoords requested: "
61 double& operator[](
unsigned int i) {
62 IMP_USAGE_CHECK(i < 3,
"Invalid component of SphericalCoords requested: "
68 Vector3D get_cartesian_coordinates();
74 void set_cartesian_coordinates(
const Vector3D& v);
80 IMPALGEBRA_END_NAMESPACE
Base class for geometric types.
#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)
Construct from a Cartesian coordinate vector.
#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)
Construct from provided spherical coordinates.
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.