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

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

Public Member Functions

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

Static Public Member Functions

static vec4f operator* (vec4f lhs, float rhs)
 Operator overloaded version of Multiply method. More...
 
static vec4f operator* (float lhs, vec4f rhs)
 Operator overloaded version of Multiply method. More...
 
static vec4f operator/ (vec4f lhs, float rhs)
 Operator overloaded version of Divide method. More...
 
static vec4f operator+ (vec4f lhs, vec4f rhs)
 Operator overloaded version of Add method. More...
 
static vec4f operator- (vec4f lhs, vec4f rhs)
 Operator overloaded version of Subtract method. More...
 
static vec4f operator- (vec4f 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...
 
float W
 The W (3-component) value. More...
 

Properties

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

Detailed Description

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

Constructor & Destructor Documentation

VectorNav.Math.vec4f.vec4f ( float  value)

Creates a new vec4f with the XYZW (0, 1, 2 and 3) components initialized to the provided value.

Parameters
valueThe value to initialize the XYZW (0, 1, 2 and 3) components with.
VectorNav.Math.vec4f.vec4f ( float  x,
float  y,
float  z,
float  w 
)

Creates a new vec4f 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.
wThe value for the W (3) component.

Member Function Documentation

vec4f VectorNav.Math.vec4f.Add ( vec4f  vector)

Adds this vec4f with the provided vec4f together.

Parameters
vectorThe vec4f to add to this vec4f.
Returns
The resultant vec4f from the addition.
vec4f VectorNav.Math.vec4f.Divide ( float  scalar)

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

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

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

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

Computes and returns the magnitude of the vec4f.

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

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

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

Negates vec4f.

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

Normalizes the vec4f.

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

Operator overloaded version of Multiply method.

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

Operator overloaded version of Multiply method.

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

Operator overloaded version of Add method.

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

Operator overloaded version of Subtract method.

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

Operator overloaded version of Negate method.

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

Operator overloaded version of Divide method.

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

Subtracts the provided vec4f from this vec4f.

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

Returns an array of the vec4f's component values.

Returns
The array containing the vec4f components.

Member Data Documentation

float VectorNav.Math.vec4f.W

The W (3-component) value.

float VectorNav.Math.vec4f.X

The X (0-component) value.

float VectorNav.Math.vec4f.Y

The Y (1-component) value.

float VectorNav.Math.vec4f.Z

The Z (2-component) value.

Property Documentation

int VectorNav.Math.vec4f.Dimension
get

The dimensions of the vec4f.

vec4f VectorNav.Math.vec4f.One
staticget

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

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

Allows indexing into the vec4f.

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

Returns a new unit vec4f in the W (3-dimension) direction.

vec4f VectorNav.Math.vec4f.UnitX
staticget

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

vec4f VectorNav.Math.vec4f.UnitY
staticget

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

vec4f VectorNav.Math.vec4f.UnitZ
staticget

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

vec4f VectorNav.Math.vec4f.Zero
staticget

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


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