MCPcopy Create free account
hub / github.com/HumbleUI/Skija / makeRotate

Method makeRotate

shared/java/Matrix33.java:153–166  ·  view source on GitHub ↗

Creates a Matrix33 to rotate by |deg| about a pivot point at (0, 0). @param deg rotation angle in degrees (positive rotates clockwise) @return Matrix33 with rotation

(float deg)

Source from the content-addressed store, hash-verified

151 * @return Matrix33 with rotation
152 */
153 @NotNull
154 public static Matrix33 makeRotate(float deg) {
155 double rad = Math.toRadians(deg);
156 double sin = Math.sin(rad);
157 double cos = Math.cos(rad);
158 double tolerance = 1f / (1 << 12);
159 if (Math.abs(sin) <= tolerance) sin = 0;
160 if (Math.abs(cos) <= tolerance) cos = 0;
161 return new Matrix33(new float[] {
162 (float) cos, (float) -sin, 0,
163 (float) sin, (float) cos, 0,
164 0, 0, 1
165 });
166 }
167
168 /**
169 * Creates a Matrix33 to rotate by |deg| about a pivot point at pivot.

Callers 9

executeMethod · 0.95
rotateMethod · 0.95
BitmapSceneMethod · 0.95
drawMethod · 0.95
drawAddsMethod · 0.95
drawTransformsMethod · 0.95
drawMethod · 0.95
BackdropSceneMethod · 0.95
drawGradientsMethod · 0.95

Calls

no outgoing calls

Tested by 1

executeMethod · 0.76