PDFsharp-net6

XVector

Namespace: PdfSharp.Drawing

Represents a two-dimensional vector specified by x- and y-coordinates. It is a displacement in 2-D space.

public struct XVector

Inheritance ObjectValueTypeXVector
Implements IFormattable

Properties

X

Gets or sets the X component of this vector.

public double X { get; set; }

Property Value

Double

Y

Gets or sets the Y component of this vector.

public double Y { get; set; }

Property Value

Double

Length

Gets the length of this vector.

public double Length { get; }

Property Value

Double

LengthSquared

Gets the square of the length of this vector.

public double LengthSquared { get; }

Property Value

Double

Constructors

XVector(Double, Double)

Initializes a new instance of the XVector struct.

XVector(double x, double y)

Parameters

x Double
The X-offset of the new Vector.

y Double
The Y-offset of the new Vector.

Methods

Equals(XVector, XVector)

Compares two vectors for equality.

bool Equals(XVector vector1, XVector vector2)

Parameters

vector1 XVector
The first vector to compare.

vector2 XVector
The second vector to compare.

Returns

Boolean

Equals(Object)

Determines whether the specified Object is a Vector structure and, if it is, whether it has the same X and Y values as this vector.

bool Equals(object o)

Parameters

o Object
The vector to compare.

Returns

Boolean

Equals(XVector)

Compares two vectors for equality.

bool Equals(XVector value)

Parameters

value XVector
The vector to compare with this vector.

Returns

Boolean

GetHashCode()

Returns the hash code for this instance.

int GetHashCode()

Returns

Int32

Parse(String)

Converts a string representation of a vector into the equivalent Vector structure.

XVector Parse(string source)

Parameters

source String
The string representation of the vector.

Returns

XVector

ToString()

Returns the string representation of this Vector structure.

string ToString()

Returns

String

ToString(IFormatProvider)

Returns the string representation of this Vector structure with the specified formatting information.

string ToString(IFormatProvider provider)

Parameters

provider IFormatProvider
The culture-specific formatting information.

Returns

String

ConvertToString(String, IFormatProvider)

string ConvertToString(string format, IFormatProvider provider)

Parameters

format String

provider IFormatProvider

Returns

String

Normalize()

Normalizes this vector.

void Normalize()

CrossProduct(XVector, XVector)

Calculates the cross product of two vectors.

double CrossProduct(XVector vector1, XVector vector2)

Parameters

vector1 XVector
The first vector to evaluate.

vector2 XVector
The second vector to evaluate.

Returns

Double

AngleBetween(XVector, XVector)

Retrieves the angle, expressed in degrees, between the two specified vectors.

double AngleBetween(XVector vector1, XVector vector2)

Parameters

vector1 XVector
The first vector to evaluate.

vector2 XVector
The second vector to evaluate.

Returns

Double

Negate()

Negates this vector. The vector has the same magnitude as before, but its direction is now opposite.

void Negate()

Add(XVector, XVector)

Adds two vectors and returns the result as a Vector structure.

XVector Add(XVector vector1, XVector vector2)

Parameters

vector1 XVector
The first vector to add.

vector2 XVector
The second vector to add.

Returns

XVector

Subtract(XVector, XVector)

Subtracts the specified vector from another specified vector.

XVector Subtract(XVector vector1, XVector vector2)

Parameters

vector1 XVector
The vector from which vector2 is subtracted.

vector2 XVector
The vector to subtract from vector1.

Returns

XVector

Add(XVector, XPoint)

Translates a point by the specified vector and returns the resulting point.

XPoint Add(XVector vector, XPoint point)

Parameters

vector XVector
The vector used to translate point.

point XPoint
The point to translate.

Returns

XPoint

Multiply(XVector, Double)

Multiplies the specified vector by the specified scalar and returns the resulting vector.

XVector Multiply(XVector vector, double scalar)

Parameters

vector XVector
The vector to multiply.

scalar Double
The scalar to multiply.

Returns

XVector

Multiply(Double, XVector)

Multiplies the specified scalar by the specified vector and returns the resulting Vector.

XVector Multiply(double scalar, XVector vector)

Parameters

scalar Double
The scalar to multiply.

vector XVector
The vector to multiply.

Returns

XVector

Divide(XVector, Double)

Divides the specified vector by the specified scalar and returns the result as a Vector.

XVector Divide(XVector vector, double scalar)

Parameters

vector XVector
The vector structure to divide.

scalar Double
The amount by which vector is divided.

Returns

XVector

Multiply(XVector, XMatrix)

Transforms the coordinate space of the specified vector using the specified Matrix.

XVector Multiply(XVector vector, XMatrix matrix)

Parameters

vector XVector
The vector to transform.

matrix XMatrix
The transformation to apply to vector.

Returns

XVector

Multiply(XVector, XVector)

Calculates the dot product of the two specified vectors and returns the result as a Double.

double Multiply(XVector vector1, XVector vector2)

Parameters

vector1 XVector
The first vector to multiply.

vector2 XVector
The second vector structure to multiply.

Returns

Double

Determinant(XVector, XVector)

Calculates the determinant of two vectors.

double Determinant(XVector vector1, XVector vector2)

Parameters

vector1 XVector
The first vector to evaluate.

vector2 XVector
The second vector to evaluate.

Returns

Double