VectorNav .NET Library
Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
VectorNav.Math.vec3d Struct Reference

Represents a Euclidean vector of dimension 3 with an underlying data value type of double. More...

Public Member Functions

override string ToString ()
 
 vec3d (double value)
 Creates a new vec3d with the XYZ (0, 1 and 2) components initialized to the provided value. More...
 
 vec3d (double x, double y, double z)
 Creates a new vec3d with the provided values for its components. More...
 
vec3d Negate ()
 Negates vec3d. More...
 
double Magnitude ()
 Computes and returns the magnitude of the vec3d. More...
 
vec3d Normalize ()
 Normalizes the vec3d. More...
 
vec3d Multiply (double scalar)
 Multiplies this vec3d by the provided scalar value and returns the result. More...
 
vec3d Divide (double scalar)
 Divides this vec3d by the provided scalar value and returns the result. More...
 
vec3d Add (vec3d vector)
 Adds this vec3d with the provided vec3d together. More...
 
vec3d Subtract (vec3d rhs)
 Subtracts the provided vec3d from this vec3d. More...
 
double DotProduct (vec3d vector)
 Computes the dot product of this vec3d and the provided vec3d. More...
 
vec3d CrossProduct (vec3d rhs)
 Computes the cross product of this vec3d and the provided vec3d. More...
 
double[] ToArray ()
 Returns an array of the vec3d's component values. More...
 

Static Public Member Functions

static vec3d operator* (vec3d lhs, double rhs)
 Operator overloaded version of Multiply method. More...
 
static vec3d operator* (double lhs, vec3d rhs)
 Operator overloaded version of Multiply method. More...
 
static vec3d operator/ (vec3d lhs, double rhs)
 Operator overloaded version of Divide method. More...
 
static vec3d operator+ (vec3d lhs, vec3d rhs)
 Operator overloaded version of Add method. More...
 
static vec3d operator- (vec3d lhs, vec3d rhs)
 Operator overloaded version of Subtract method. More...
 
static vec3d operator- (vec3d value)
 Operator overloaded version of Negate method. More...
 

Public Attributes

double X
 The X (0-component) value. More...
 
double Y
 The Y (1-component) value. More...
 
double Z
 The Z (2-component) value. More...
 

Properties

int Dimension [get]
 The dimensions of the vec3d. More...
 
static vec3d Zero [get]
 Returns a new vec3d with all of its components initialized to 0. More...
 
static vec3d One [get]
 Returns a new vec3d with all of its components initialized to 1. More...
 
static vec3d UnitX [get]
 Returns a new unit vec3d in the X (0-dimension) direction. More...
 
static vec3d UnitY [get]
 Returns a new unit vec3d in the Y (1-dimension) direction. More...
 
static vec3d UnitZ [get]
 Returns a new unit vec3d in the Z (2-dimension) direction. More...
 
double this[int index] [get, set]
 Allows indexing into the vec3d. More...
 

Detailed Description

Represents a Euclidean vector of dimension 3 with an underlying data value type of double.

Constructor & Destructor Documentation

VectorNav.Math.vec3d.vec3d ( double  value)

Creates a new vec3d with the XYZ (0, 1 and 2) components initialized to the provided value.

Parameters
valueThe value to initialize the XYZ (0, 1 and 2) components with.
VectorNav.Math.vec3d.vec3d ( double  x,
double  y,
double  z 
)

Creates a new vec3d with the provided values for its components.

Parameters
xThe value for the X (0) component.
yThe value for the Y (1) component.
zThe value for the Z (2) component.

Member Function Documentation

vec3d VectorNav.Math.vec3d.Add ( vec3d  vector)

Adds this vec3d with the provided vec3d together.

Parameters
vectorThe vec3d to add to this vec3d.
Returns
The resultant vec3d from the addition.
vec3d VectorNav.Math.vec3d.CrossProduct ( vec3d  rhs)

Computes the cross product of this vec3d and the provided vec3d.

Parameters
rhsThe vec3d to compute the cross product with this.
Returns
The computed cross product.
vec3d VectorNav.Math.vec3d.Divide ( double  scalar)

Divides this vec3d by the provided scalar value and returns the result.

Parameters
scalarThe scalar value to divide this vec3d by.
Returns
The resulting vec3d.
Exceptions
DivideByZeroExceptionThe provided scalar had a value of zero.
double VectorNav.Math.vec3d.DotProduct ( vec3d  vector)

Computes the dot product of this vec3d and the provided vec3d.

Parameters
vectorThe vec3d to compute the dot product with this.
Returns
The computed dot product.
double VectorNav.Math.vec3d.Magnitude ( )

Computes and returns the magnitude of the vec3d.

Returns
The computed magnitude.
vec3d VectorNav.Math.vec3d.Multiply ( double  scalar)

Multiplies this vec3d by the provided scalar value and returns the result.

Parameters
scalarThe scalar value to multiply this vec3d by.
Returns
The resulting vec3d.
vec3d VectorNav.Math.vec3d.Negate ( )

Negates vec3d.

Returns
The negated vec3d.
vec3d VectorNav.Math.vec3d.Normalize ( )

Normalizes the vec3d.

Returns
The normalized vec3d.
static vec3d VectorNav.Math.vec3d.operator* ( vec3d  lhs,
double  rhs 
)
static

Operator overloaded version of Multiply method.

Parameters
lhsThe left-side vec3d of the multiplication symbol.
rhsThe right-side scalar of the multiplication symbol.
Returns
The vec3d resulting from the operation.
static vec3d VectorNav.Math.vec3d.operator* ( double  lhs,
vec3d  rhs 
)
static

Operator overloaded version of Multiply method.

Parameters
lhsThe left-side scalar of the multiplication symbol.
rhsThe right-side vec3d of the multiplication symbol.
Returns
The vec3d resulting from the operation.
static vec3d VectorNav.Math.vec3d.operator+ ( vec3d  lhs,
vec3d  rhs 
)
static

Operator overloaded version of Add method.

Parameters
lhsThe left-side vec3d of the addition symbol.
rhsThe right-side vec3d of the addition symbol.
Returns
The vec3d resulting from the operation.
static vec3d VectorNav.Math.vec3d.operator- ( vec3d  lhs,
vec3d  rhs 
)
static

Operator overloaded version of Subtract method.

Parameters
lhsThe left-side vec3d of the subtraction symbol.
rhsThe right-side vec3d of the subtraction symbol.
Returns
The vec3d resulting from the operation.
static vec3d VectorNav.Math.vec3d.operator- ( vec3d  value)
static

Operator overloaded version of Negate method.

Parameters
valueThe vec3d to negate.
Returns
The negated vec3d.
static vec3d VectorNav.Math.vec3d.operator/ ( vec3d  lhs,
double  rhs 
)
static

Operator overloaded version of Divide method.

Parameters
lhsThe left-side vec3d of the division symbol.
rhsThe right-side scalar of the division symbol.
Returns
The vec3d resulting from the operation.
vec3d VectorNav.Math.vec3d.Subtract ( vec3d  rhs)

Subtracts the provided vec3d from this vec3d.

Parameters
rhsThe vec3d to subtract from this vec3d.
Returns
The resultant vec3d from the subtraction.
double [] VectorNav.Math.vec3d.ToArray ( )

Returns an array of the vec3d's component values.

Returns
The array containing the vec3d components.

Member Data Documentation

double VectorNav.Math.vec3d.X

The X (0-component) value.

double VectorNav.Math.vec3d.Y

The Y (1-component) value.

double VectorNav.Math.vec3d.Z

The Z (2-component) value.

Property Documentation

int VectorNav.Math.vec3d.Dimension
get

The dimensions of the vec3d.

vec3d VectorNav.Math.vec3d.One
staticget

Returns a new vec3d with all of its components initialized to 1.

double VectorNav.Math.vec3d.this[int index]
getset

Allows indexing into the vec3d.

Parameters
indexThe specified index. Must be in the range [0, 2].
Returns
The value at the specified index.
Exceptions
IndexOutOfRangeExceptionThrown if the specified index is out of range.
vec3d VectorNav.Math.vec3d.UnitX
staticget

Returns a new unit vec3d in the X (0-dimension) direction.

vec3d VectorNav.Math.vec3d.UnitY
staticget

Returns a new unit vec3d in the Y (1-dimension) direction.

vec3d VectorNav.Math.vec3d.UnitZ
staticget

Returns a new unit vec3d in the Z (2-dimension) direction.

vec3d VectorNav.Math.vec3d.Zero
staticget

Returns a new vec3d with all of its components initialized to 0.


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