MCPcopy Create free account
hub / github.com/Teneted/Tenet / rotateAroundZ

Method rotateAroundZ

src/main/java/org/bukkit/util/Vector.java:471–479  ·  view source on GitHub ↗

Rotates the vector around the z axis This piece of math is based on the standard rotation matrix for vectors in three dimensional space. This matrix can be found here: Rotation Matrix . @param angle the angle to rotate t

(double angle)

Source from the content-addressed store, hash-verified

469 * @return the same vector
470 */
471 @NotNull
472 public Vector rotateAroundZ(double angle) {
473 double angleCos = Math.cos(angle);
474 double angleSin = Math.sin(angle);
475
476 double x = angleCos * getX() - angleSin * getY();
477 double y = angleSin * getX() + angleCos * getY();
478 return setX(x).setY(y);
479 }
480
481 /**
482 * Rotates the vector around a given arbitrary axis in 3 dimensional space.

Callers

nothing calls this directly

Calls 4

getXMethod · 0.95
getYMethod · 0.95
setXMethod · 0.95
setYMethod · 0.45

Tested by

no test coverage detected