USML
wvector1 Class Reference

Detailed Description

Individual world vector in spherical earth coordinates.

Each of the three coordinate parameters (rho,theta,phi) is a scalar. This class is a convenience to save the developer from doing a lot of operations on 1x1 matrices.

Constructor & Destructor Documentation

wvector1 ( double  r = 0.0,
double  t = 0.0,
double  p = 0.0 
)

Constructs an individual vector.

wvector1 ( const wvector other,
unsigned  row,
unsigned  col 
)

Copy one element from a matrix of world vectors.

Member Function Documentation

double area ( const wvector1 p2,
const wvector1 p3 
) const

Compute the surface area between three points in space.

The distances between the vertices in the triangle (this,p2,p3) can be used to compute the surface area using the formula:

                a = length(this,p2)
                b = length(this,p3)
                c = length(p2,p3)
     area = 1/4 sqrt[ (a+b+c)(b+c-a)(c+a-b)(a+b-c) ]
References:
Weisstein, Eric W. "Triangle Area." From MathWorld - A Wolfram Web Resource. http://mathworld.wolfram.com/TriangleArea.html
Parameters
p2Second point in space
p3Third point in space
double area ( const wvector1 p2,
const wvector1 p3,
const wvector1 p4 
) const

Compute the surface area between four points in space.

Similar to the three point version, but this one combines two triangle (this,p2,p3) and (this,p3,p4) to form the complete solution. This allows the distance from this to p3 to be reused.

Parameters
p2Second point in space
p3Third point in space
p4Forth point in space
void clear ( )

Reset all data elements back to zero.

void direction ( double *  de,
double *  az 
)

Extract depression/elevation and azimuthal angles from acoustic ray direction in the local tangent plane.

Used to extract ray angle information from eigenray collisions with targets.

Parameters
deInitial depression/elevation angle at the source location (degrees, positive is up).
azInitial azimuthal angle at the source location (degrees, clockwise from true north).
void direction ( const wvector1 pos,
const wvector1 dir 
)

Compute acoustic ray direction in the local tangent plane using the spherical earth geocentric direction vector.

Used to re-initialize the direction of propagation after reflection.

Parameters
posPosition from which direction is measured.
dirDirection in terms of a spherical earth vector (input).
void direction ( const wvector1 pos,
wvector1 dir 
)

Extract spherical earth geocentric direction from acoustic ray direction in the local tangent plane.

Used to extract grazing angle information at the beginning of the reflection process.

Parameters
posPosition from which direction is measured.
dirDirection in terms of a spherical earth vector (output).
double distance ( const wvector1 origin) const

Compute the straight line distance between this point and some other point in space.

Parameters
originPoint from which distance is measured.
Returns
Distance from this point to the origin point.
double distance2 ( const wvector1 origin) const

Compute the square of the straight line distance between this point and some other point in space.

Parameters
originPoint from which distance is measured.
Returns
Distance from this point to the origin point.
double dot ( const wvector1 other) const

Compute the dot product between this vector and some other spherical earth vector.

Parameters
otherSecond vector in the dot product.
Returns
Dot product between these two vectors.
double dotnorm ( const wvector1 other) const

Dot product divided by the magnitude of the two vectors.

Parameters
otherSecond vector in the dot product.
Returns
Normalized dot product between these two vectors.
double phi ( ) const
inline

Retrieves the longitude component of the spherical earth coordinate system.

Returns
Longitude coordinate in radians.
void phi ( double  p)
inline

Defines the longitude component of the spherical earth coordinate.

Parameters
pLongitude coordinate in radians.
double rho ( ) const
inline

Retrieves the radial component of the spherical earth coordinate system.

Returns
Radial coordinate in meters.
void rho ( double  r)
inline

Defines the radial component of the spherical earth coordinate.

Parameters
rRadial coordinate in meters.
double theta ( ) const
inline

Retrieves the colatitude component of the spherical earth coordinate system.

Returns
Colatitude coordinate in radians.
void theta ( double  t)
inline

Defines the colatitude component of the spherical earth coordinate.

Parameters
tColatitude coordinate in radians.

Member Data Documentation

double _phi
private

Storage for the longitude component of the coordinate system.

double _rho
private

Storage for the radial component of the coordinate system.

double _theta
private

Storage for the colatitude component of the coordinate system.