C# Class Accord.Math.Vector3

显示文件 Open project: accord-net/framework Class Usage Examples

Public Properties

Property Type Description
X float
Y float
Z float

Public Methods

Method Description
Abs ( ) : Vector3

Calculate absolute values of the vector.

Add ( Vector3 vector1, Vector3 vector2 ) : Vector3

Adds corresponding coordinates of two vectors.

Add ( Vector3 vector, float value ) : Vector3

Adds a value to all coordinates of the specified vector.

Cross ( Vector3 vector1, Vector3 vector2 ) : Vector3

Calculates cross product of two vectors.

Divide ( Vector3 vector1, Vector3 vector2 ) : Vector3

Divides corresponding coordinates of two vectors.

Divide ( Vector3 vector, float factor ) : Vector3

Divides coordinates of the specified vector by the specified factor.

Dot ( Vector3 vector1, Vector3 vector2 ) : float

Calculates dot product of two vectors.

Equals ( Object obj ) : bool

Tests whether the vector equals to the specified object.

Equals ( Vector3 vector ) : bool

Tests whether the vector equals to the specified one.

GetHashCode ( ) : int

Returns the hashcode for this instance.

Inverse ( ) : Vector3

Inverse the vector.

Multiply ( Vector3 vector1, Vector3 vector2 ) : Vector3

Multiplies corresponding coordinates of two vectors.

Multiply ( Vector3 vector, float factor ) : Vector3

Multiplies coordinates of the specified vector by the specified factor.

Normalize ( ) : float

Normalizes the vector by dividing it’s all coordinates with the vector's norm.

Subtract ( Vector3 vector1, Vector3 vector2 ) : Vector3

Subtracts corresponding coordinates of two vectors.

Subtract ( Vector3 vector, float value ) : Vector3

Subtracts a value from all coordinates of the specified vector.

ToArray ( ) : float[]

Returns array representation of the vector.

ToString ( ) : string

Returns a string representation of this object.

ToVector4 ( ) : Vector4

Converts the vector to a 4D vector.

The method returns a 4D vector which has X, Y and Z coordinates equal to the coordinates of this 3D vector and W coordinate set to 1.0.

Vector3 ( float value ) : System

Initializes a new instance of the Vector3 structure.

Vector3 ( float x, float y, float z ) : System

Initializes a new instance of the Vector3 structure.

operator ( ) : Vector3

Adds corresponding coordinates of two vectors.

operator ( ) : bool

Tests whether two specified vectors are equal.

Method Details

Abs() public method

Calculate absolute values of the vector.
public Abs ( ) : Vector3
return Vector3

Add() public static method

Adds corresponding coordinates of two vectors.
public static Add ( Vector3 vector1, Vector3 vector2 ) : Vector3
vector1 Vector3 The vector to add to.
vector2 Vector3 The vector to add to the first vector.
return Vector3

Add() public static method

Adds a value to all coordinates of the specified vector.
public static Add ( Vector3 vector, float value ) : Vector3
vector Vector3 Vector to add the specified value to.
value float Value to add to all coordinates of the vector.
return Vector3

Cross() public static method

Calculates cross product of two vectors.
public static Cross ( Vector3 vector1, Vector3 vector2 ) : Vector3
vector1 Vector3 First vector to use for cross product calculation.
vector2 Vector3 Second vector to use for cross product calculation.
return Vector3

Divide() public static method

Divides corresponding coordinates of two vectors.
public static Divide ( Vector3 vector1, Vector3 vector2 ) : Vector3
vector1 Vector3 The first vector to divide.
vector2 Vector3 The second vector to devide.
return Vector3

Divide() public static method

Divides coordinates of the specified vector by the specified factor.
public static Divide ( Vector3 vector, float factor ) : Vector3
vector Vector3 Vector to divide coordinates of.
factor float Factor to divide coordinates of the specified vector by.
return Vector3

Dot() public static method

Calculates dot product of two vectors.
public static Dot ( Vector3 vector1, Vector3 vector2 ) : float
vector1 Vector3 First vector to use for dot product calculation.
vector2 Vector3 Second vector to use for dot product calculation.
return float

Equals() public method

Tests whether the vector equals to the specified object.
public Equals ( Object obj ) : bool
obj Object The object to test equality with.
return bool

Equals() public method

Tests whether the vector equals to the specified one.
public Equals ( Vector3 vector ) : bool
vector Vector3 The vector to test equality with.
return bool

GetHashCode() public method

Returns the hashcode for this instance.
public GetHashCode ( ) : int
return int

Inverse() public method

Inverse the vector.
public Inverse ( ) : Vector3
return Vector3

Multiply() public static method

Multiplies corresponding coordinates of two vectors.
public static Multiply ( Vector3 vector1, Vector3 vector2 ) : Vector3
vector1 Vector3 The first vector to multiply.
vector2 Vector3 The second vector to multiply.
return Vector3

Multiply() public static method

Multiplies coordinates of the specified vector by the specified factor.
public static Multiply ( Vector3 vector, float factor ) : Vector3
vector Vector3 Vector to multiply coordinates of.
factor float Factor to multiple coordinates of the specified vector by.
return Vector3

Normalize() public method

Normalizes the vector by dividing it’s all coordinates with the vector's norm.
public Normalize ( ) : float
return float

Subtract() public static method

Subtracts corresponding coordinates of two vectors.
public static Subtract ( Vector3 vector1, Vector3 vector2 ) : Vector3
vector1 Vector3 The vector to subtract from.
vector2 Vector3 The vector to subtract from the first vector.
return Vector3

Subtract() public static method

Subtracts a value from all coordinates of the specified vector.
public static Subtract ( Vector3 vector, float value ) : Vector3
vector Vector3 Vector to subtract the specified value from.
value float Value to subtract from all coordinates of the vector.
return Vector3

ToArray() public method

Returns array representation of the vector.
public ToArray ( ) : float[]
return float[]

ToString() public method

Returns a string representation of this object.
public ToString ( ) : string
return string

ToVector4() public method

Converts the vector to a 4D vector.

The method returns a 4D vector which has X, Y and Z coordinates equal to the coordinates of this 3D vector and W coordinate set to 1.0.

public ToVector4 ( ) : Vector4
return Vector4

Vector3() public method

Initializes a new instance of the Vector3 structure.
public Vector3 ( float value ) : System
value float Value, which is set to all 3 coordinates of the vector.
return System

Vector3() public method

Initializes a new instance of the Vector3 structure.
public Vector3 ( float x, float y, float z ) : System
x float X coordinate of the vector.
y float Y coordinate of the vector.
z float Z coordinate of the vector.
return System

operator() public static method

Adds corresponding coordinates of two vectors.
public static operator ( ) : Vector3
return Vector3

operator() public static method

Tests whether two specified vectors are equal.
public static operator ( ) : bool
return bool

Property Details

X public_oe property

X coordinate of the vector.
public float X
return float

Y public_oe property

Y coordinate of the vector.
public float Y
return float

Z public_oe property

Z coordinate of the vector.
public float Z
return float