This class computes Cartesian and Spherical components of a poition vector in space emanating from origin.
More...
#include <wxmspherical.h>
This class computes Cartesian and Spherical components of a poition vector in space emanating from origin.
◆ SphericalPositionVector() [1/2]
SphericalPositionVector::SphericalPositionVector |
( |
const std::vector< real > |
n | ) |
|
Initialize the position vector with Cartesian components (typically a normal)
- Parameters
-
n | The normal with 3 Cartesian components n[0] is x n[1] is y n[2] is z |
n | Normal vector |
◆ SphericalPositionVector() [2/2]
SphericalPositionVector::SphericalPositionVector |
( |
const real |
r, |
|
|
const real |
theta, |
|
|
const real |
phi |
|
) |
| |
Initialize the position vector with Sphherical components.
- Parameters
-
r | Length of vector |
theta | angle from z axis (latitude) |
phi | angle on x-y plane from x direction (longitude) |
◆ calculate_phi()
real SphericalPositionVector::calculate_phi |
( |
| ) |
|
|
protected |
phi is the longitude angle along x-y plane is arctan2(y/x)
◆ calculate_r()
real SphericalPositionVector::calculate_r |
( |
| ) |
|
|
protected |
r is the length of the vector (assumed to emanate from origin) should be sqrt (x**2 + y**2 + z**2)
◆ calculate_theta()
real SphericalPositionVector::calculate_theta |
( |
| ) |
|
|
protected |
theta is the angle off the z axis (gives lattitude) is arccos(z/r) or equivalently arctan2(sqrt(x^2+y^2)/z)
◆ calculate_vec()
std::vector< real > SphericalPositionVector::calculate_vec |
( |
| ) |
|
|
protected |
◆ calculate_x()
real SphericalPositionVector::calculate_x |
( |
| ) |
|
|
protected |
calculate x component is r*sin(theta)*cos(phi)
◆ calculate_y()
real SphericalPositionVector::calculate_y |
( |
| ) |
|
|
protected |
calculate y component is r*sin(theta)*sin(phi)
◆ calculate_z()
real SphericalPositionVector::calculate_z |
( |
| ) |
|
|
protected |
calculate z component is r*cos(theta)
◆ CalculateFromRTHETAPHI()
void SphericalPositionVector::CalculateFromRTHETAPHI |
( |
real |
r, |
|
|
real |
theta, |
|
|
real |
phi |
|
) |
| |
◆ get_phi()
real SphericalPositionVector::get_phi |
( |
| ) |
const |
|
inline |
◆ get_r()
real SphericalPositionVector::get_r |
( |
| ) |
const |
|
inline |
◆ get_theta()
real SphericalPositionVector::get_theta |
( |
| ) |
const |
|
inline |
◆ get_x()
real SphericalPositionVector::get_x |
( |
| ) |
const |
|
inline |
◆ get_y()
real SphericalPositionVector::get_y |
( |
| ) |
const |
|
inline |
◆ get_z()
real SphericalPositionVector::get_z |
( |
| ) |
const |
|
inline |
◆ print()
void SphericalPositionVector::print |
( |
std::stringstream & |
ss | ) |
|
◆ set_phi()
void SphericalPositionVector::set_phi |
( |
real |
phi | ) |
|
|
inlineprotected |
◆ set_r()
void SphericalPositionVector::set_r |
( |
real |
r | ) |
|
|
inlineprotected |
Setters: Shouldn't do these without recalculating all attributes.
setter of r
◆ set_theta()
void SphericalPositionVector::set_theta |
( |
real |
theta | ) |
|
|
inlineprotected |
◆ _phi
real SphericalPositionVector::_phi |
|
protected |
◆ _r
real SphericalPositionVector::_r |
|
protected |
◆ _theta
real SphericalPositionVector::_theta |
|
protected |
◆ _vec
std::vector<real> SphericalPositionVector::_vec |
|
protected |
The documentation for this class was generated from the following file: