Namespaces

Types in MathNet.Spatial.Euclidean

Type Vector3D

Namespace MathNet.Spatial.Euclidean

Parent ValueType

Interfaces IXmlSerializable, IEquatable<Vector3D>, IEquatable<UnitVector3D>, IFormattable

A struct representing a vector in 3D space

Constructors

Static Functions

Methods

Properties

Fields

Public Constructors

Vector3D(Double[] data)

Initializes a new instance of the Vector3D struct.
Obsolete: This constructor will be removed. Made obsolete 2017-12-05.
Parameters
Double[] data

A list of 3 doubles

Vector3D(double x, double y, double z)

Initializes a new instance of the Vector3D struct.
Parameters
double x

The x component.

double y

The y component.

double z

The z component.

Vector3D(IEnumerable<double> data)

Initializes a new instance of the Vector3D struct.
Obsolete: This constructor will be removed. Made obsolete 2017-12-05.
Parameters
IEnumerable<double> data

A list of 3 doubles

Public Static Functions

Vector3D OfVector(Vector<double> vector)

Create a new Vector3D from a Math.NET Numerics vector of length 3.
Parameters
Vector<double> vector

A vector with length 2 to populate the created instance with.

Return
Vector3D

A Vector3D

Vector3D Parse(string value, IFormatProvider formatProvider)

Attempts to convert a string of the form x,y,z into a vector
Parameters
string value

The string to be converted

IFormatProvider formatProvider

The IFormatProvider

Return
Vector3D

A point at the coordinates specified

Vector3D ReadFrom(XmlReader reader)

Creates an Vector3D from an XmlReader.
Parameters
XmlReader reader

An XmlReader positioned at the node to read into this Vector3D.

Return
Vector3D

An Vector3D that contains the data read from the reader.

bool TryParse(string text, IFormatProvider formatProvider, Vector3D& result)

bool TryParse(string text, Vector3D& result)

Public Methods

Vector3D Add(Vector3D v)

Adds a vector to this
Obsolete: Use + instead
Parameters
Vector3D v

a vector to add

Return
Vector3D

A new vector

Angle AngleTo(UnitVector3D v)

Compute the angle between this vector and a unit vector using the arccosine of the dot product.
Parameters
UnitVector3D v

The other vector

Return
Angle

The angle between the vectors, with a range between 0° and 180°

Angle AngleTo(Vector3D v)

Compute the angle between this vector and another using the arccosine of the dot product.
Parameters
Vector3D v

The other vector

Return
Angle

The angle between the vectors, with a range between 0° and 180°

Vector3D CrossProduct(UnitVector3D other)

Returns the cross product of this vector and other
Parameters
UnitVector3D other

A vector

Return
Vector3D

A new vector with the cross product result

Vector3D CrossProduct(Vector3D other)

Returns the cross product of this vector and other
Parameters
Vector3D other

A vector

Return
Vector3D

A new vector with the cross product result

double DotProduct(Vector3D v)

Returns the dot product of two vectors.
Parameters
Vector3D v

The second vector.

Return
double

The dot product.

double DotProduct(UnitVector3D v)

Returns the dot product of two vectors.
Parameters
UnitVector3D v

The second vector.

Return
double

The dot product.

bool Equals(Vector3D other, double tolerance)

Returns a value to indicate if a pair of vectors are equal
Parameters
Vector3D other

The vector to compare against.

double tolerance

A tolerance (epsilon) to adjust for floating point error

Return
bool

true if the vectors are equal; otherwise false

bool Equals(Vector3D other)

bool Equals(UnitVector3D other)

bool Equals(object obj)

bool Equals(UnitVector3D other, double tolerance)

Returns a value to indicate if this vector is equivalent to a given unit vector
Parameters
UnitVector3D other

The unit vector to compare against.

double tolerance

A tolerance (epsilon) to adjust for floating point error

Return
bool

true if the vectors are equal; otherwise false

int GetHashCode()

Type GetType()

Matrix<double> GetUnitTensorProduct()

Returns a dense Matrix with the unit tensor product [ux^2, ux*uy, ux*uz], [ux*uy, uy^2, uy*uz], [ux*uz, uy*uz, uz^2]
Return
Matrix<double>

a dense matrix

bool IsParallelTo(UnitVector3D other, double tolerance)

Computes whether or not this vector is parallel to a unit vector using the dot product method and comparing it to within a specified tolerance.
Parameters
UnitVector3D other

The other UnitVector3D

double tolerance

A tolerance value for the dot product method. Values below 2*Precision.DoublePrecision may cause issues.

Return
bool

true if the vector dot product is within the given tolerance of unity, false if not

bool IsParallelTo(Vector3D other, Angle tolerance)

Determine whether or not this vector is parallel to another vector within a given angle tolerance.
Parameters
Vector3D other

The other Vector3D

Angle tolerance

The tolerance for when the vectors are considered parallel.

Return
bool

true if the vectors are parallel within the angle tolerance, false if they are not

bool IsParallelTo(UnitVector3D other, Angle tolerance)

Determine whether or not this vector is parallel to a unit vector within a given angle tolerance.
Parameters
UnitVector3D other

The other UnitVector3D

Angle tolerance

The tolerance for when the vectors are considered parallel.

Return
bool

true if the vectors are parallel within the angle tolerance, false if they are not

bool IsParallelTo(Vector3D other, double tolerance)

Computes whether or not this vector is parallel to another vector using the dot product method and comparing it to within a specified tolerance.
Parameters
Vector3D other

The other Vector3D

double tolerance

A tolerance value for the dot product method. Values below 2*Precision.DoublePrecision may cause issues.

Return
bool

true if the vector dot product is within the given tolerance of unity, false if it is not

bool IsPerpendicularTo(Vector3D other, double tolerance)

Computes whether or not this vector is perpendicular to another vector using the dot product method and comparing it to within a specified tolerance
Parameters
Vector3D other

The other Vector3D

double tolerance

A tolerance value for the dot product method. Values below 2*Precision.DoublePrecision may cause issues.

Return
bool

true if the vector dot product is within the given tolerance of zero, false if not

bool IsPerpendicularTo(UnitVector3D other, double tolerance)

Computes whether or not this vector is perpendicular to another vector using the dot product method and comparing it to within a specified tolerance
Parameters
UnitVector3D other

The other UnitVector3D

double tolerance

A tolerance value for the dot product method. Values below 2*Precision.DoublePrecision may cause issues.

Return
bool

true if the vector dot product is within the given tolerance of zero, false if not

Vector3D Negate()

Inverses the direction of the vector, equivalent to multiplying by -1
Return
Vector3D

A Vector3D pointing in the opposite direction.

UnitVector3D Normalize()

Compute and return a unit vector from this vector
Return
UnitVector3D

a normalized unit vector

Vector3D ProjectOn(UnitVector3D uv)

Returns the Dot product of the current vector and a unit vector
Parameters
UnitVector3D uv

A unit vector

Return
Vector3D

Returns a new vector

Ray3D ProjectOn(Plane planeToProjectOn)

Projects the vector onto a plane
Parameters
Plane planeToProjectOn

A geometric plane

Return
Ray3D

A ray

Vector3D Rotate(Vector3D about, Angle angle)

Returns a vector that is this vector rotated the signed angle around the about vector
Parameters
Vector3D about

A vector to rotate about

Angle angle

A signed angle

Return
Vector3D

A rotated vector.

Vector3D Rotate(UnitVector3D about, Angle angle)

Returns a vector that is this vector rotated the signed angle around the about vector
Parameters
UnitVector3D about

A unit vector to rotate about

Angle angle

A signed angle

Return
Vector3D

A rotated vector.

Vector3D Rotate<T>(UnitVector3D about, double angle, T angleUnit)

Rotates a Vector
Obsolete: This method will be removed prefer the other overload.. Made obsolete 2017-12-05.
Parameters
UnitVector3D about

A unit vector

double angle

An angle

T angleUnit

A type of angle

Return
Vector3D

A new vector

Vector3D ScaleBy(double scaleFactor)

Multiplies the current vector by a scalar
Parameters
double scaleFactor

a scalar

Return
Vector3D

A new scaled vector

Angle SignedAngleTo(Vector3D v, UnitVector3D about)

Returns signed angle
Parameters
Vector3D v

The vector to calculate the signed angle to

UnitVector3D about

The vector around which to rotate to get the correct sign

Return
Angle

A signed Angle

Angle SignedAngleTo(UnitVector3D v, UnitVector3D about)

Returns signed angle
Parameters
UnitVector3D v

The vector to calculate the signed angle to

UnitVector3D about

The vector around which to rotate to get the correct sign

Return
Angle

A signed angle

Vector3D Subtract(Vector3D v)

Subtracts a vector from this
Obsolete: Use - instead
Parameters
Vector3D v

a vector to subtract

Return
Vector3D

A new vector

Point3D ToPoint3D()

Returns a point equivalent to the vector
Return
Point3D

A point

string ToString(string format, IFormatProvider provider)

string ToString()

string ToString(IFormatProvider provider)

Returns a string representation of this instance using the provided IFormatProvider
Parameters
IFormatProvider provider

A IFormatProvider

Return
string

The string representation of this instance.

Vector<double> ToVector()

Convert to a Math.NET Numerics dense vector of length 3.
Return
Vector<double>

A dense vector

Vector3D TransformBy(Matrix<double> m)

Transforms a vector by multiplying it against a provided matrix
Parameters
Matrix<double> m

The matrix to multiply

Return
Vector3D

A new transformed vector

Vector3D TransformBy(CoordinateSystem coordinateSystem)

Transforms the vector by a coordinate system and returns the transformed.
Parameters
CoordinateSystem coordinateSystem

A coordinate system

Return
Vector3D

A new transformed vector

Public Properties

double Length get;

Gets the Euclidean Norm.

Vector3D NaN get;

Gets an invalid vector with no values

UnitVector3D Orthogonal get;

Gets a unit vector orthogonal to this

Public fields

double X

The x component.
return double

double Y

The y component.
return double

double Z

The z component.
return double