vector3_i.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifdef __GNUC__
00029 #pragma interface
00030 #endif
00031
00032 #ifdef INLINE_FUNCTIONS
00033 #define INLINE inline
00034 #else
00035 #define INLINE
00036 #endif
00037
00038 namespace sc {
00039
00040 INLINE void
00041 SCVector3::spherical_coord(double theta, double phi,
00042 double r)
00043 {
00044 double rsin_theta = r*sin(theta);
00045 _v[0]=rsin_theta*cos(phi);
00046 _v[1]=rsin_theta*sin(phi);
00047 _v[2]=r*cos(theta);
00048 }
00049
00050 INLINE double
00051 SCVector3::dist(const SCVector3 &s) const
00052 {
00053 double x=_v[0]-s._v[0],y=_v[1]-s._v[1],z=_v[2]-s._v[2];
00054 return sqrt(x*x + y*y + z*z);
00055 }
00056
00057 }
00058
00059 #undef INLINE
00060
00061
00062
00063
00064
Generated at Sat Aug 7 00:04:22 2004 for MPQC
2.2.2 using the documentation package Doxygen
1.3.8.