HTM SpatialIndex Class Reference

class SpatialVector

The SpatialVector is a 3D vector usually living on the surface of the sphere

Public Methods

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
SpatialVector& operator = (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

Public

Scalar products with int and float
SpatialVector& operator *= (float64)
SpatialVector& operator *= (int)
friend SpatialVector operator * (float64, const SpatialVector &)
friend SpatialVector operator * (int, const SpatialVector &)
friend SpatialVector operator * (const SpatialVector &, float64)
friend SpatialVector operator * (const SpatialVector &, int)

Documentation

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.
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

SpatialVector& operator =(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

Scalar products with int and float

SpatialVector& operator *= (float64)

SpatialVector& operator *=(int)

friend SpatialVector operator *(float64, const SpatialVector &)

friend SpatialVector operator *(int, const SpatialVector &)

friend SpatialVector operator *(const SpatialVector &, float64)

friend SpatialVector operator *(const SpatialVector &, int)


This class has no child classes.

alphabetic index hierarchy of classes


© Copyright The Johns Hopkins University 1999, All Rights Reserved.
Peter Z. Kunszt,

generated by doc++