BPoint3d Class Reference

#include <BPoint3d.h>

Inheritance diagram for BPoint3d:

Inheritance graph
[legend]

List of all members.


Detailed Description

A lightweight class representing a coordinate point with three dimensions.

This class does not have any constructors, and this allows it to be used as an aggregate. As an aggregate, BPoint3d can be initialized using an initializer list, for example: BPoint3d pt = {1.1, 2.2, 3.3};. This form of initialization is faster than initialization using a constructor.

The meaning of the BPoint3d's x, y, and z fields is dependent upon the type of coordinate system in which the point exists. In a Cartesian coordinate system, the x, y, and z fields correspond the the x, y, and z coordinates, respectively. In a projected coordinate system, such as a UTM zone, The x field gives the east (or easting) coordinate, the y field gives the north (or northing) coordinate, and the z field gives the height coordinate. In a geodetic (or lat/lon) coordinate system, the x field gives the longitude coordinate, the y field gives the latitude coordinate, and the z field gives the height coordinate.

Public Member Functions

BPoint3dAbs ()
 Updates this BPoint3d to contain its absolute value.
BPoint3dCross (const BPoint3d &p, BPoint3d &result) const
 Computes the cross product of this BPoint2d and the input BPoint2d, assuming that these points represent vectors.
BPoint3d Cross (const BPoint3d &p) const
 Computes the cross product of this BPoint2d and the input BPoint2d, assuming that these points represent vectors.
double Dot (const BPoint3d &p) const
 Computes the dot product of this BPoint3d and the input BPoint3d.
void GetCoords (double &xOut, double &yOut, double &zOut) const
 Retrieves the coordinate values.
double Magnitude () const
 Computes the magnitude.
double MagnitudeSquared () const
 Computes the magnitude squared.
BPoint3dNormalize ()
 Modifies the coordinates of this BPoint3d such that its distance from the origin is exactly one unit.
BPoint3d operator * (double d) const
 Multiplication operator.
BPoint3doperator *= (double d)
 Assignment by multiplication operator.
bool operator!= (const BPoint3d &p) const
 Inequality operator.
BPoint3d operator+ (double d) const
 Addition operator.
BPoint3d operator+ (const BPoint3d &p) const
 Addition operator.
BPoint3doperator+= (double d)
 Assignment by addition operator.
BPoint3doperator+= (const BPoint3d &p)
 Assignment by addition operator.
BPoint3d operator- (double d) const
 Subtraction operator.
BPoint3d operator- () const
 Unary minus operator.
BPoint3d operator- (const BPoint3d &p) const
 Subtraction operator.
BPoint3doperator-= (double d)
 Assignment by subtraction operator.
BPoint3doperator-= (const BPoint3d &p)
 Assignment by subtraction operator.
BPoint3d operator/ (double d) const
 Division operator.
BPoint3doperator/= (double d)
 Assignment by division operator.
bool operator== (const BPoint3d &p) const
 Equality operator.
double Perp (const BPoint3d &p) const
 Computes the perpendicular product of this point and the input point.
BPoint3dSetCoords (double xIn, double yIn, double zIn)
 Sets the coordinate values.

Public Attributes

double x
 The x, east, or longitude coordinate.
double y
 The y, north, or latitude coordinate.
double z
 The z or height coordinate.


Member Function Documentation

BPoint3d& Abs (  )  [inline]

Updates this BPoint3d to contain its absolute value.

Returns:
A reference to this BPoint3d.

BPoint3d& Cross ( const BPoint3d p,
BPoint3d result 
) const [inline]

Computes the cross product of this BPoint2d and the input BPoint2d, assuming that these points represent vectors.

Parameters:
p The input point.
result The resulting cross product.
Returns:
The cross product of this point and the input point.

BPoint3d Cross ( const BPoint3d p  )  const [inline]

Computes the cross product of this BPoint2d and the input BPoint2d, assuming that these points represent vectors.

Parameters:
p The input point.
Returns:
The cross product of this point and the input point.

double Dot ( const BPoint3d p  )  const [inline]

Computes the dot product of this BPoint3d and the input BPoint3d.

Parameters:
p The input point.
Returns:
The dot product of this BPoint3d and the input BPoint3d.

void GetCoords ( double &  xOut,
double &  yOut,
double &  zOut 
) const [inline]

Retrieves the coordinate values.

Parameters:
xOut The x-coordinate.
yOut The y-coordinate.
zOut The z-coordinate.

double Magnitude (  )  const [inline]

Computes the magnitude.

The magnitude of a BPoint2d is the distance from this BPoint3d to the origin.

Returns:
The magnitude. The units used to express the magnitude are the same as the units used to express the location of this BPoint3d.

double MagnitudeSquared (  )  const [inline]

Computes the magnitude squared.

This is the square of the distance from this BPoint3d to the origin.

Returns:
The magnitude squared.

BPoint3d& Normalize (  )  [inline]

Modifies the coordinates of this BPoint3d such that its distance from the origin is exactly one unit.

The result of this method is undefined if this BPoint3d coincides with the origin.

Returns:
A reference to this BPoint3d.

BPoint3d operator * ( double  d  )  const [inline]

Multiplication operator.

This operator will multiply the value of each coordinate by the specified double value.

Parameters:
d The value by which to multiply each coordinate.
Returns:
A reference to this BPoint3d, with updated coordinate values.

BPoint3d& operator *= ( double  d  )  [inline]

Assignment by multiplication operator.

This operator will multiply the value of each coordinate by the specified double value.

Parameters:
d The value by which to multiply each coordinate.
Returns:
A reference to this BPoint3d, with updated coordinate values.

bool operator!= ( const BPoint3d p  )  const [inline]

Inequality operator.

Parameters:
p The BPoint3d to compare to this one.
Returns:
True if the specified BPoint3d does not have the same value as this one and false otherwise.

BPoint3d operator+ ( double  d  )  const [inline]

Addition operator.

This operator will add the specified double value to the value of each coordinate.

Parameters:
d The value by which to increment the coordinates.
Returns:
A reference to this BPoint3d, with updated coordinate values.

BPoint3d operator+ ( const BPoint3d p  )  const [inline]

Addition operator.

Adds the value of the specified BPoint3d to the value of this BPoint3d. The addition is performed as vector addition.

Parameters:
p The BPoint3d whose value will be added to this one.
Returns:
A reference to this BPoint3d, with updated coordinate values.

BPoint3d& operator+= ( double  d  )  [inline]

Assignment by addition operator.

This operator will increment the value of each coordinate in this BPoint3d by the specified value.

Parameters:
d The value by which to increment the coordinates.
Returns:
A reference to this BPoint3d, with updated coordinate values.

BPoint3d& operator+= ( const BPoint3d p  )  [inline]

Assignment by addition operator.

Adds the value of the specified BPoint3d to the value of this BPoint3d. The addition is performed as vector addition.

Parameters:
p The BPoint3d whose value will be added to this one.
Returns:
A reference to this BPoint3d, with updated coordinate values.

BPoint3d operator- ( double  d  )  const [inline]

Subtraction operator.

This operator will decrement the value of each coordinate in this BPoint3d by the specified value.

Parameters:
d The value by which to decrement the coordinates.
Returns:
A reference to this BPoint3d, with updated coordinate values.

BPoint3d operator- (  )  const [inline]

Unary minus operator.

This operator reverses the sign of the coordinate values on this BPoint3d. This is equivalent to scalar multiplication by -1.

Returns:
A reference to this BPoint3d, with updated coordinate values.

BPoint3d operator- ( const BPoint3d p  )  const [inline]

Subtraction operator.

Subtracts the value of the specified BPoint3d from the value of this BPoint3d. The subtraction is performed as vector subtraction.

Parameters:
p The BPoint3d whose value will be subtracted from this one.
Returns:
A reference to this BPoint3d, with updated coordinate values.

BPoint3d& operator-= ( double  d  )  [inline]

Assignment by subtraction operator.

This operator will decrement the value of each coordinate in this BPoint3d by the specified value.

Parameters:
d The value by which to decrement the coordinates.
Returns:
A reference to this BPoint3d, with updated coordinate values.

BPoint3d& operator-= ( const BPoint3d p  )  [inline]

Assignment by subtraction operator.

Subtracts the value of the specified BPoint3d from the value of this BPoint3d. The subtraction is performed as vector subtraction.

Parameters:
p The BPoint3d whose value will be subtracted from this one.
Returns:
A reference to this BPoint3d, with updated coordinate values.

BPoint3d operator/ ( double  d  )  const [inline]

Division operator.

This operator will divide the value of each coordinate by the specified double value.

Parameters:
d The value by which to divide each coordinate. This must be a non-zero value.
Returns:
A reference to this BPoint3d, with updated coordinate values.

BPoint3d& operator/= ( double  d  )  [inline]

Assignment by division operator.

This operator will divide the value of each coordinate by the specified double value.

Parameters:
d The value by which to divide each coordinate. This must be a non-zero value.
Returns:
A reference to this BPoint3d, with updated coordinate values.

bool operator== ( const BPoint3d p  )  const [inline]

Equality operator.

Parameters:
p The BPoint3d to compare to this one.
Returns:
True if the specified BPoint3d has the same value as this one and false otherwise.

double Perp ( const BPoint3d p  )  const [inline]

Computes the perpendicular product of this point and the input point.

Parameters:
p The input point.
Returns:
the perpendicular product of this BPoint3d and the input BPoint3d.

BPoint3d& SetCoords ( double  xIn,
double  yIn,
double  zIn 
) [inline]

Sets the coordinate values.

Parameters:
xIn The x-coordinate.
yIn The y-coordinate.
zIn The z-coordinate.
Returns:
A reference to this BPoint3d.


Member Data Documentation

double x

The x, east, or longitude coordinate.

double y

The y, north, or latitude coordinate.

double z

The z or height coordinate.


The documentation for this class was generated from the following file:

GeoTranslate 5.0 From Blue Marble Geographics