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

Method rotateAroundX

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

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

425 * @return the same vector
426 */
427 @NotNull
428 public Vector rotateAroundX(double angle) {
429 double angleCos = Math.cos(angle);
430 double angleSin = Math.sin(angle);
431
432 double y = angleCos * getY() - angleSin * getZ();
433 double z = angleSin * getY() + angleCos * getZ();
434 return setY(y).setZ(z);
435 }
436
437 /**
438 * Rotates the vector around the y axis.

Callers

nothing calls this directly

Calls 4

getYMethod · 0.95
getZMethod · 0.95
setYMethod · 0.95
setZMethod · 0.45

Tested by

no test coverage detected