Transform2D

References
public struct Transform2D
Represents a transformation matrix for two-dimensional shader coordinate transformations.

Properties

IsIdentity

#
public bool IsIdentity { get; }
Gets whether this transformation is the identity matrix.

Methods

Apply

#
public void Apply(double x, double y, out double xPrime, out double yPrime)
Transform a coordinate pair.
x (double)Input x.
y (double)Input y.
xPrime (out double)Output x.
yPrime (out double)Output y.

Chain

#
public static Transform2D Chain(params Transform2D[] transforms)
Chain a set of transformations.
transforms (params Transform2D[])Consecutive transformations.
Combined transform.

Change

#
public static Transform2D Change((double x, double y) xAxis, (double x, double y) yAxis)
Create a change-basis transformation centered on the world origin.
xAxis ((double x, double y))X axis vector.
yAxis ((double x, double y))Y axis vector.
Change of basis transformation.

CrossProd

#
public static double CrossProd(double x1, double y1, double x2, double y2)
Compute the cross product of two vectors.
x1 (double)First vector x component.
y1 (double)First vector y component.
x2 (double)Second vector x component.
y2 (double)Second vector y component.
Cross product.

CrossSign

#
public static int CrossSign(double x1, double y1, double x2, double y2)
Compute the sign of the cross product of two vectors.
x1 (double)First vector x component.
y1 (double)First vector y component.
x2 (double)Second vector x component.
y2 (double)Second vector y component.
True if the cross product is positive.

Move

#
public static Transform2D Move(double motionX, double motionY)
Create a new move (or translation) transform.
motionX (double)Motion along X.
motionY (double)Motion along Y.
Motion.

Rotate

#
public static Transform2D Rotate(Angle angle, double anchorX, double anchorY)
Create a rotation matrix.
angle (Angle)Rotation angle.
anchorX (double)Scaling centre point X coordinate.
anchorY (double)Scaling centre point Y coordinate.
Matrix.

Rotate

#
public static Transform2D Rotate(Angle angle)
Create a rotation matrix.
angle (Angle)Rotation angle.
Matrix.

Scale

#
public static Transform2D Scale(double factor)
Create a uniform scaling transform.
factor (double)Scaling factor.
Transformation.

Scale

#
public static Transform2D Scale(double factorX, double factorY, double anchorX, double anchorY)
Create a uniform scaling transform.
factorX (double)Scaling factor along X.
factorY (double)Scaling factor along Y.
anchorX (double)Scaling centre point X coordinate.
anchorY (double)Scaling centre point Y coordinate.
Transformation.

Scale

#
public static Transform2D Scale(double factorX, double factorY)
Create a uniform scaling transform.
factorX (double)Scaling factor along X.
factorY (double)Scaling factor along Y.
Transformation.

Operators

OperationResultDescription
Transform2D*Transform2DTransform2DMultiply two matrices.
-Transform2DTransform2DCreate the inverse of a transform.