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 Object → ValueType → XVector
Implements IFormattable
Gets or sets the X component of this vector.
public double X { get; set; }
Gets or sets the Y component of this vector.
public double Y { get; set; }
Gets the length of this vector.
public double Length { get; }
Gets the square of the length of this vector.
public double LengthSquared { get; }
Initializes a new instance of the XVector struct.
XVector(double x, double y)
x Double
The X-offset of the new Vector.
y Double
The Y-offset of the new Vector.
Compares two vectors for equality.
bool Equals(XVector vector1, XVector vector2)
vector1 XVector
The first vector to compare.
vector2 XVector
The second vector to compare.
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)
o Object
The vector to compare.
Compares two vectors for equality.
bool Equals(XVector value)
value XVector
The vector to compare with this vector.
Returns the hash code for this instance.
int GetHashCode()
Converts a string representation of a vector into the equivalent Vector structure.
XVector Parse(string source)
source String
The string representation of the vector.
Returns the string representation of this Vector structure.
string ToString()
Returns the string representation of this Vector structure with the specified formatting information.
string ToString(IFormatProvider provider)
provider IFormatProvider
The culture-specific formatting information.
string ConvertToString(string format, IFormatProvider provider)
format String
provider IFormatProvider
Normalizes this vector.
void Normalize()
Calculates the cross product of two vectors.
double CrossProduct(XVector vector1, XVector vector2)
vector1 XVector
The first vector to evaluate.
vector2 XVector
The second vector to evaluate.
Retrieves the angle, expressed in degrees, between the two specified vectors.
double AngleBetween(XVector vector1, XVector vector2)
vector1 XVector
The first vector to evaluate.
vector2 XVector
The second vector to evaluate.
Negates this vector. The vector has the same magnitude as before, but its direction is now opposite.
void Negate()
Adds two vectors and returns the result as a Vector structure.
XVector Add(XVector vector1, XVector vector2)
vector1 XVector
The first vector to add.
vector2 XVector
The second vector to add.
Subtracts the specified vector from another specified vector.
XVector Subtract(XVector vector1, XVector vector2)
vector1 XVector
The vector from which vector2 is subtracted.
vector2 XVector
The vector to subtract from vector1.
Translates a point by the specified vector and returns the resulting point.
XPoint Add(XVector vector, XPoint point)
vector XVector
The vector used to translate point.
point XPoint
The point to translate.
Multiplies the specified vector by the specified scalar and returns the resulting vector.
XVector Multiply(XVector vector, double scalar)
vector XVector
The vector to multiply.
scalar Double
The scalar to multiply.
Multiplies the specified scalar by the specified vector and returns the resulting Vector.
XVector Multiply(double scalar, XVector vector)
scalar Double
The scalar to multiply.
vector XVector
The vector to multiply.
Divides the specified vector by the specified scalar and returns the result as a Vector.
XVector Divide(XVector vector, double scalar)
vector XVector
The vector structure to divide.
scalar Double
The amount by which vector is divided.
Transforms the coordinate space of the specified vector using the specified Matrix.
XVector Multiply(XVector vector, XMatrix matrix)
vector XVector
The vector to transform.
matrix XMatrix
The transformation to apply to vector.
Calculates the dot product of the two specified vectors and returns the result as a Double.
double Multiply(XVector vector1, XVector vector2)
vector1 XVector
The first vector to multiply.
vector2 XVector
The second vector structure to multiply.
Calculates the determinant of two vectors.
double Determinant(XVector vector1, XVector vector2)
vector1 XVector
The first vector to evaluate.
vector2 XVector
The second vector to evaluate.