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
31 bool check(
double r,
double theta,
double psi);
38 set_cartesian_coordinates(v);
47 double psi,
bool apply_check=
true) {
49 if(!check(r,theta,psi)) {
50 String msg =
"SphericalCoords:: wrong SphericalCoords coordinates." ;
59 double operator[](
unsigned int i)
const {
60 IMP_USAGE_CHECK(i < 3,
"Invalid component of SphericalCoords requested: "
65 double& operator[](
unsigned int i) {
66 IMP_USAGE_CHECK(i < 3,
"Invalid component of SphericalCoords requested: "
72 Vector3D get_cartesian_coordinates();
75 out << v_[0] <<
" , " << v_[1] <<
" , "
79 void set_cartesian_coordinates(
const Vector3D& v);
85 IMPALGEBRA_END_NAMESPACE