fromRotation

fun fromRotation(angle: Double, result: Matrix2? = definedExternally): Matrix2(source)

Creates a rotation matrix.

// Rotate a point 45 degrees counterclockwise.
const p = new Cartesian2(5, 6);
const m = Matrix2.fromRotation(Math.toRadians(45.0));
const rotated = Matrix2.multiplyByVector(m, p, new Cartesian2());

Return

The modified result parameter, or a new Matrix2 instance if one was not provided.

Parameters

angle

The angle, in radians, of the rotation. Positive angles are counterclockwise.

result

The object in which the result will be stored, if undefined a new instance will be created.

See also