SpatialVector Class Reference

#include <SpatialVector.h>

Collaboration diagram for SpatialVector:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SpatialVector ()
 constructs (1,0,0), ra=0, dec=0.
 SpatialVector (float64 x, float64 y, float64 z)
 Constructor from three coordinates, not necessarily normed to 1.
 SpatialVector (float64 ra, float64 dec)
 Constructor from ra/dec, this is always normed to 1.
 SpatialVector (const SpatialVector &)
 Copy constructor.
SpatialVectoroperator= (const SpatialVector &)
 Assignment.
void set (const float64 &x, const float64 &y, const float64 &z)
 Set member function: set values - always normed to 1.
void set (const float64 &ra, const float64 &dec)
 Set member function: set values - always normed to 1.
void get (float64 &x, float64 &y, float64 &z) const
 Get x,y,z.
void get (float64 &ra, float64 &dec)
 Get ra,dec - normalizes x,y,z.
float64 length () const
 return length of vector
float64 x () const
 return x (only as rvalue)
float64 y () const
 return y
float64 z () const
 return z
float64 ra ()
 return ra - this norms the vector to 1 if not already done so
float64 dec ()
 return dec - this norms the vector to 1 if not already done so
void normalize ()
 Normalize vector length to 1.
void show () const
 Printf it to stdout.
void read (istream &)
 Read vector from a stream.
void write (ostream &) const
 Write vector to a stream.
int operator== (const SpatialVector &) const
 Comparison.
float64 operator* (const SpatialVector &) const
 dot product
SpatialVector operator^ (const SpatialVector &) const
 cross product
SpatialVector operator+ (const SpatialVector &) const
 addition
SpatialVector operator- (const SpatialVector &) const
 subtraction

Private Member Functions

void updateXYZ ()
void updateRaDec ()

Private Attributes

float64 x_
float64 y_
float64 z_
float64 ra_
float64 dec_
bool okRaDec_

Friends

class SpatialIndex
class SpatialDomain
class sxSpatialDomain

operator *=



SpatialVector operator* (float64, const SpatialVector &)
SpatialVector operator* (int, const SpatialVector &)
SpatialVector operator* (const SpatialVector &, float64)
SpatialVector operator* (const SpatialVector &, int)
SpatialVectoroperator*= (float64)
SpatialVectoroperator*= (int)

Detailed Description

The SpatialVector is a 3D vector usually living on the surface of the sphere. The corresponding ra, dec can be obtained if the vector has unit length. That can be ensured with the normalize() function.


Constructor & Destructor Documentation

SpatialVector::SpatialVector (  ) 

constructs (1,0,0), ra=0, dec=0.

Referenced by operator+(), operator-(), and operator^().

SpatialVector::SpatialVector ( float64  x,
float64  y,
float64  z 
)

Constructor from three coordinates, not necessarily normed to 1.

SpatialVector::SpatialVector ( float64  ra,
float64  dec 
)

Constructor from ra/dec, this is always normed to 1.

References updateRaDec(), and updateXYZ().

SpatialVector::SpatialVector ( const SpatialVector vv  ) 

Copy constructor.


Member Function Documentation

float64 SpatialVector::dec (  ) 

return dec - this norms the vector to 1 if not already done so

References dec_, normalize(), okRaDec_, and updateRaDec().

void SpatialVector::get ( float64 ra,
float64 dec 
)

Get ra,dec - normalizes x,y,z.

References dec_, normalize(), okRaDec_, ra_, and updateRaDec().

void SpatialVector::get ( float64 x,
float64 y,
float64 z 
) const

Get x,y,z.

References x_, y_, and z_.

float64 SpatialVector::length (  )  const

return length of vector

References gEpsilon, x_, y_, and z_.

void SpatialVector::normalize (  ) 

Normalize vector length to 1.

References x_, y_, and z_.

Referenced by dec(), get(), SpatialIndex::idByPoint(), SpatialIndex::nodeVertex(), ra(), and set().

float64 SpatialVector::operator* ( const SpatialVector v  )  const

dot product

References x_, y_, and z_.

SpatialVector & SpatialVector::operator*= ( int  a  ) 

References okRaDec_, x_, y_, and z_.

SpatialVector & SpatialVector::operator*= ( float64  a  ) 

References okRaDec_, x_, y_, and z_.

SpatialVector SpatialVector::operator+ ( const SpatialVector v  )  const

addition

References SpatialVector(), x_, y_, and z_.

SpatialVector SpatialVector::operator- ( const SpatialVector v  )  const

subtraction

References SpatialVector(), x_, y_, and z_.

SpatialVector & SpatialVector::operator= ( const SpatialVector vv  ) 

Assignment.

References dec_, okRaDec_, ra_, x_, y_, and z_.

int SpatialVector::operator== ( const SpatialVector v  )  const

Comparison.

References x_, y_, and z_.

SpatialVector SpatialVector::operator^ ( const SpatialVector v  )  const

cross product

References SpatialVector(), x_, y_, and z_.

float64 SpatialVector::ra (  ) 

return ra - this norms the vector to 1 if not already done so

References normalize(), okRaDec_, ra_, and updateRaDec().

void SpatialVector::read ( istream &  in  ) 

Read vector from a stream.

References x_, y_, and z_.

Referenced by operator>>().

void SpatialVector::set ( const float64 ra,
const float64 dec 
)

Set member function: set values - always normed to 1.

References dec_, ra_, and updateXYZ().

void SpatialVector::set ( const float64 x,
const float64 y,
const float64 z 
)

Set member function: set values - always normed to 1.

References normalize(), updateRaDec(), x_, y_, and z_.

void SpatialVector::show (  )  const

Printf it to stdout.

References x_, y_, and z_.

void SpatialVector::updateRaDec (  )  [private]

References dec_, gEpsilon, gPr, okRaDec_, ra_, x_, y_, and z_.

Referenced by dec(), get(), ra(), set(), and SpatialVector().

void SpatialVector::updateXYZ (  )  [private]

References dec_, gPr, ra_, x_, y_, and z_.

Referenced by set(), and SpatialVector().

void SpatialVector::write ( ostream &  out  )  const

Write vector to a stream.

References x_, y_, and z_.

Referenced by operator<<().

float64 SpatialVector::x (  )  const [inline]

return x (only as rvalue)

References x_.

float64 SpatialVector::y (  )  const [inline]

return y

References y_.

float64 SpatialVector::z (  )  const [inline]

return z

References z_.


Friends And Related Function Documentation

SpatialVector operator* ( const SpatialVector ,
int   
) [friend]
SpatialVector operator* ( const SpatialVector ,
float64   
) [friend]
SpatialVector operator* ( int  ,
const SpatialVector  
) [friend]
SpatialVector operator* ( float64  ,
const SpatialVector  
) [friend]
friend class SpatialDomain [friend]
friend class SpatialIndex [friend]
friend class sxSpatialDomain [friend]

Member Data Documentation

bool SpatialVector::okRaDec_ [private]

The documentation for this class was generated from the following files:
Generated on Mon Oct 4 10:39:49 2010 for HtmSrc by  doxygen 1.6.3