## Types in MathNet.Spatial.Euclidean

Type Vector2D

Namespace MathNet.Spatial.Euclidean

Parent ValueType

Interfaces IXmlSerializable, IEquatable<Vector2D>, IFormattable

A struct representing a vector in 2D space

### Public Constructors

#### Vector2D(double x, double y)

Initializes a new instance of the Vector2D struct.

The x component.

The y component.

### Public Static Functions

Creates a Vector from Polar coordinates
##### Parameters
###### `double` radius

The distance of the point from the origin

###### `Angle` angle

The angle of the point as measured from the X Axis

A vector.

#### Vector2DOfVector(Vector<double> vector)

Create a new Vector2D from a Math.NET Numerics vector of length 2.
##### Parameters
###### `Vector<double>` vector

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

#### Vector2DParse(string value, IFormatProvider formatProvider)

Attempts to convert a string of the form x,y into a point
##### Parameters
###### `string` value

The string to be converted

##### Return
###### `Vector2D`

A point at the coordinates specified

Creates an Vector2D from an XmlReader.

### Public Methods

Adds a vector to this vector

##### Return
###### `Vector2D`

A new vector which is the sum of the existing vector and the provided vector

#### AngleAngleTo(Vector2D other)

Compute the angle between this vector and another using the arccosine of the dot product.
##### Parameters
###### `Vector2D` other

The other Vector2D

##### Return
###### `Angle`

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

#### doubleCrossProduct(Vector2D other)

Performs the 2D 'cross product' as if the 2D vectors were really 3D vectors in the z=0 plane, returning the scalar magnitude and direction of the resulting z value. Formula: (X * other.Y) - (Y * other.X)
##### Parameters
###### `Vector2D` other

The other Vector2D

##### Return
###### `double`

(X * other.Y) - (Y * other.X)

#### doubleDotProduct(Vector2D other)

Perform the dot product on a pair of vectors
##### Parameters
###### `Vector2D` other

The second vector

##### Return
###### `double`

The result of the dot product.

#### boolEquals(Vector2D other, double tolerance)

Compare this instance with other
##### Parameters
###### `Vector2D` other

The other Vector2D

###### `double` tolerance

The tolerance when comparing the x and y components

##### Return
###### `bool`

True if found to be equal.

#### boolIsParallelTo(Vector2D other, Angle tolerance)

Computes whether or not this vector is parallel to another vector within a given angle tolerance.
##### Parameters
###### `Vector2D` other

The other Vector2D

###### `Angle` tolerance

The tolerance for when vectors are said to be parallel

##### Return
###### `bool`

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

#### boolIsParallelTo(Vector2D other, double tolerance)

Computes whether or not this vector is perpendicular to other vector by: 1. Normalizing both 2. Computing the dot product. 3. Comparing 1- Math.Abs(dot product) to tolerance
##### Parameters
###### `Vector2D` other

The other Vector2D

###### `double` tolerance

The tolerance for when vectors are said to be parallel

##### Return
###### `bool`

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

#### boolIsPerpendicularTo(Vector2D other, Angle tolerance)

Computes whether or not this vector is parallel to another vector within a given angle tolerance.
##### Parameters
###### `Vector2D` other

The other Vector2D

###### `Angle` tolerance

The tolerance for when vectors are said to be parallel

##### Return
###### `bool`

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

#### boolIsPerpendicularTo(Vector2D other, double tolerance)

Computes whether or not this vector is perpendicular to other vector by: 1. Normalizing both 2. Computing the dot product. 3. Comparing Math.Abs(dot product) to tolerance
##### Parameters
###### `Vector2D` other

The other Vector2D

###### `double` tolerance

The tolerance for when vectors are said to be parallel

##### Return
###### `bool`

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

#### Vector2DNegate()

Returns the negative of the vector
##### Return
###### `Vector2D`

A new negated vector.

#### Vector2DNormalize()

Creates a new unit vector from the existing vector.
##### Return
###### `Vector2D`

A new unit vector in the same direction as the original vector

#### Vector2DProjectOn(Vector2D other)

Projects this vector onto another vector
##### Parameters
###### `Vector2D` other

The other Vector2D

##### Return
###### `Vector2D`

A Vector2D representing this vector projected on other

#### Vector2DRotate(Angle angle)

Rotates a Vector by an angle

The angle.

##### Return
###### `Vector2D`

A new rotated vector.

#### Vector2DScaleBy(double d)

Scales the vector by the provided value

a scaling factor

#### AngleSignedAngleTo(Vector2D other, bool clockWise, bool returnNegative)

Compute the signed angle to another vector.
##### Parameters
###### `Vector2D` other

The other Vector2D

###### `bool` clockWise

Positive in clockwise direction

###### `bool` returnNegative

When true and the result is > 180° a negative value is returned

##### Return
###### `Angle`

The angle between the vectors.

#### Vector2DSubtract(Vector2D v)

Subtracts a vector from this vector.
##### Parameters
###### `Vector2D` v

A vector to subtract

##### Return
###### `Vector2D`

A new vector which is the difference of the current vector and the provided vector

#### stringToString(IFormatProvider provider)

Returns a string representation of this instance using the provided IFormatProvider
##### Return
###### `string`

The string representation of this instance.

#### Vector<double>ToVector()

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

A Vector`1 with the x and y values from this instance.

#### Vector2DTransformBy(Matrix<double> m)

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

The matrix to multiply

##### Return
###### `Vector2D`

A new transformed vector

### Public Properties

#### doubleLength get;

Gets the length of the vector

#### Vector2DOrthogonal get;

Gets a vector orthogonal to this

#### Vector2DXAxis get;

Gets a vector representing the X Axis

#### Vector2DYAxis get;

Gets a vector representing the Y Axis

### Public fields

#### double X

The x component.
 `return double`

#### double Y

The y component.
 `return double`