SpatialVector

Search for usage in LXR

SpatialVector Class Reference

#include <SpatialVector.h>

Public Member Functions

 SpatialVector ()
 
 SpatialVector (float64 ra, float64 dec)
 
 SpatialVector (float64 x, float64 y, float64 z)
 
float64 dec ()
 
void get (float64 &ra, float64 &dec)
 
void get (float64 &x, float64 &y, float64 &z) const
 
float64 length () const
 
void normalize ()
 
float64 operator* (const SpatialVector &) const
 
SpatialVector operator+ (const SpatialVector &) const
 
SpatialVector operator- (const SpatialVector &) const
 
int operator== (const SpatialVector &) const
 
SpatialVector operator^ (const SpatialVector &) const
 
float64 ra ()
 
void set (const float64 &ra, const float64 &dec)
 
void set (const float64 &x, const float64 &y, const float64 &z)
 
float64 x () const
 
float64 y () const
 
float64 z () const
 

operator *=

SpatialVectoroperator*= (float64)
 
SpatialVectoroperator*= (int)
 

Detailed Description

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.

Definition at line 32 of file SpatialVector.h.

Constructor & Destructor Documentation

◆ SpatialVector() [1/3]

SpatialVector::SpatialVector ( )

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

Definition at line 29 of file SpatialVector.cpp.

◆ SpatialVector() [2/3]

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

Constructor from three coordinates, not necessarily normed to 1.

Definition at line 33 of file SpatialVector.cpp.

◆ SpatialVector() [3/3]

SpatialVector::SpatialVector ( float64 ra,
float64 dec )

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

Definition at line 39 of file SpatialVector.cpp.

Member Function Documentation

◆ dec()

float64 SpatialVector::dec ( )

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

Definition at line 96 of file SpatialVector.cpp.

◆ get() [1/2]

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

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

Definition at line 75 of file SpatialVector.cpp.

◆ get() [2/2]

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

Get x,y,z.

Definition at line 66 of file SpatialVector.cpp.

◆ length()

float64 SpatialVector::length ( ) const

return length of vector

Definition at line 128 of file SpatialVector.cpp.

◆ normalize()

void SpatialVector::normalize ( )

Normalize vector length to 1.

Definition at line 108 of file SpatialVector.cpp.

◆ operator*()

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

dot product

Definition at line 220 of file SpatialVector.cpp.

◆ operator*=() [1/2]

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

Definition at line 165 of file SpatialVector.cpp.

◆ operator*=() [2/2]

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

Definition at line 176 of file SpatialVector.cpp.

◆ operator+()

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

addition

Definition at line 227 of file SpatialVector.cpp.

◆ operator-()

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

subtraction

Definition at line 234 of file SpatialVector.cpp.

◆ operator==()

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

Comparison.

Definition at line 249 of file SpatialVector.cpp.

◆ operator^()

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

cross product

Definition at line 242 of file SpatialVector.cpp.

◆ ra()

float64 SpatialVector::ra ( )

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

Definition at line 86 of file SpatialVector.cpp.

◆ set() [1/2]

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

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

Definition at line 57 of file SpatialVector.cpp.

◆ set() [2/2]

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

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

Definition at line 47 of file SpatialVector.cpp.

◆ x()

float64 SpatialVector::x ( ) const
inline

return x (only as rvalue)

Definition at line 60 of file SpatialVector.h.

◆ y()

float64 SpatialVector::y ( ) const
inline

return y

Definition at line 63 of file SpatialVector.h.

◆ z()

float64 SpatialVector::z ( ) const
inline

return z

Definition at line 66 of file SpatialVector.h.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:15:14 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.