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

Method rotateAroundY

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

Rotates the vector around the y 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

(double angle)

Source from the content-addressed store, hash-verified

447 * @return the same vector
448 */
449 @NotNull
450 public Vector rotateAroundY(double angle) {
451 double angleCos = Math.cos(angle);
452 double angleSin = Math.sin(angle);
453
454 double x = angleCos * getX() + angleSin * getZ();
455 double z = -angleSin * getX() + angleCos * getZ();
456 return setX(x).setZ(z);
457 }
458
459 /**
460 * Rotates the vector around the z axis

Callers

nothing calls this directly

Calls 4

getXMethod · 0.95
getZMethod · 0.95
setXMethod · 0.95
setZMethod · 0.45

Tested by

no test coverage detected