Transform2D

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

Properties

IsIdentity

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

Methods

Apply

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

Chain

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

Change

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

CrossProd

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

CrossSign

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

Move

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

Rotate

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

Rotate

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

Scale

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

Scale

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

Scale

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

Operators

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