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

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

Public Member Functions

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

Static Public Member Functions

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

Public Attributes

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

Properties

int Dimension [get]
 The dimensions of the vec3f. More...
 
float R [get, set]
 The red (0-component) value. More...
 
float G [get, set]
 The green (1-component) value. More...
 
float B [get, set]
 The blue (2-component) value. More...
 
static vec3f Zero [get]
 Returns a new vec3f with all of its components initialized to 0. More...
 
static vec3f One [get]
 Returns a new vec3f with all of its components initialized to 1. More...
 
static vec3f UnitX [get]
 Returns a new unit vec3f in the X (0-dimension) direction. More...
 
static vec3f UnitY [get]
 Returns a new unit vec3f in the Y (1-dimension) direction. More...
 
static vec3f UnitZ [get]
 Returns a new unit vec3f in the Z (2-dimension) direction. More...
 
float this[int index] [get, set]
 Allows indexing into the vec3f. More...
 

Detailed Description

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

Constructor & Destructor Documentation

VectorNav.Math.vec3f.vec3f ( float  value)

Creates a new vec3f 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.vec3f.vec3f ( float  x,
float  y,
float  z 
)

Creates a new vec3f 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

vec3f VectorNav.Math.vec3f.Add ( vec3f  vector)

Adds this vec3f with the provided vec3f together.

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

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

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

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

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

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

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

Computes and returns the magnitude of the vec3f.

Returns
The computed magnitude.
vec3f VectorNav.Math.vec3f.Multiply ( float  scalar)

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

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

Negates vec3f.

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

Normalizes the vec3f.

Returns
The normalized vec3f.
static vec3f VectorNav.Math.vec3f.operator* ( vec3f  lhs,
float  rhs 
)
static

Operator overloaded version of Multiply method.

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

Operator overloaded version of Multiply method.

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

Operator overloaded version of Add method.

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

Operator overloaded version of Subtract method.

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

Operator overloaded version of Negate method.

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

Operator overloaded version of Divide method.

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

Subtracts the provided vec3f from this vec3f.

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

Returns an array of the vec3f's component values.

Returns
The array containing the vec3f components.
vec3f VectorNav.Math.vec3f.ToDeg ( )

Converts the current vector of radian angles to a vector of degree angles.

Returns
The values converted to degree angles.
vec3f VectorNav.Math.vec3f.ToRad ( )

Converts the current vector of degree angles to a vector of radian angles.

Returns
The values converted to radian angles.

Member Data Documentation

float VectorNav.Math.vec3f.X

The X (0-component) value.

float VectorNav.Math.vec3f.Y

The Y (1-component) value.

float VectorNav.Math.vec3f.Z

The Z (2-component) value.

Property Documentation

float VectorNav.Math.vec3f.B
getset

The blue (2-component) value.

int VectorNav.Math.vec3f.Dimension
get

The dimensions of the vec3f.

float VectorNav.Math.vec3f.G
getset

The green (1-component) value.

vec3f VectorNav.Math.vec3f.One
staticget

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

float VectorNav.Math.vec3f.R
getset

The red (0-component) value.

float VectorNav.Math.vec3f.this[int index]
getset

Allows indexing into the vec3f.

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.
vec3f VectorNav.Math.vec3f.UnitX
staticget

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

vec3f VectorNav.Math.vec3f.UnitY
staticget

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

vec3f VectorNav.Math.vec3f.UnitZ
staticget

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

vec3f VectorNav.Math.vec3f.Zero
staticget

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


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