public class MathUtils
extends java.lang.Object
Constructor and Description |
---|
MathUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
approxEquals(double accuracy,
double equalTo,
double... equals) |
static boolean |
approxEquals(double accuracy,
int equalTo,
int... equals) |
static boolean |
approxEquals(double accuracy,
long equalTo,
long... equals) |
static long |
elapsed(long time) |
static boolean |
elapsed(long time,
long needed) |
static int |
floor(double var0) |
static long |
gcd(long... input) |
static long |
gcd(long a,
long b) |
static float |
getAngleDelta(float one,
float two) |
static org.bukkit.util.Vector |
getCenterOfBox(BoundingBox box) |
static double |
getDelta(double one,
double two) |
static float |
getDelta(float one,
float two) |
static long |
getDelta(int one,
int two) |
static long |
getDelta(long one,
long two) |
static double |
getDirection(org.bukkit.Location from,
org.bukkit.Location to) |
static double |
getDistanceToBox(org.bukkit.util.Vector vec,
BoundingBox box) |
static int |
getDistanceToGround(org.bukkit.entity.Player p) |
static double |
getHorizontalDistance(org.bukkit.Location from,
org.bukkit.Location to) |
static double[] |
getOffsetFromEntity(org.bukkit.entity.Player player,
org.bukkit.entity.LivingEntity entity) |
static double[] |
getOffsetFromLocation(org.bukkit.Location one,
org.bukkit.Location two) |
static float[] |
getRotations(org.bukkit.entity.LivingEntity origin,
org.bukkit.entity.LivingEntity point) |
static float[] |
getRotations(org.bukkit.Location one,
org.bukkit.Location two) |
static double |
getVerticalDistance(org.bukkit.Location from,
org.bukkit.Location to) |
static double |
getYawDifference(org.bukkit.Location one,
org.bukkit.Location two) |
static double |
hypot(double... value) |
static float |
hypot(float... value) |
static boolean |
isLookingTowardsEntity(org.bukkit.Location from,
org.bukkit.Location to,
org.bukkit.entity.LivingEntity entity) |
static long |
lcm(long... input) |
static long |
lcm(long a,
long b) |
static int |
millisToTicks(long millis) |
static double |
normalizeAngle(double yaw) |
static float |
normalizeAngle(float yaw) |
static double |
offset(org.bukkit.util.Vector from,
org.bukkit.util.Vector to) |
static boolean |
playerLooked(org.bukkit.Location from,
org.bukkit.Location to) |
static boolean |
playerMoved(org.bukkit.Location from,
org.bukkit.Location to) |
static boolean |
playerMoved(org.bukkit.util.Vector from,
org.bukkit.util.Vector to) |
static double |
round(double value) |
static double |
round(double value,
int places) |
static double |
round(double value,
int places,
java.math.RoundingMode mode) |
static float |
round(float value) |
static float |
round(float value,
int places) |
static float |
round(float value,
int places,
java.math.RoundingMode mode) |
static double |
trim(int degree,
double d) |
static float |
trimFloat(int degree,
float d) |
static int |
tryParse(java.lang.String string) |
static double |
yawTo180D(double dub) |
static float |
yawTo180F(float flub) |
public static double offset(org.bukkit.util.Vector from, org.bukkit.util.Vector to)
public static boolean playerMoved(org.bukkit.Location from, org.bukkit.Location to)
public static boolean approxEquals(double accuracy, double equalTo, double... equals)
public static boolean approxEquals(double accuracy, int equalTo, int... equals)
public static boolean approxEquals(double accuracy, long equalTo, long... equals)
public static double getDistanceToBox(org.bukkit.util.Vector vec, BoundingBox box)
public static org.bukkit.util.Vector getCenterOfBox(BoundingBox box)
public static int tryParse(java.lang.String string)
public static double hypot(double... value)
public static float hypot(float... value)
public static boolean playerMoved(org.bukkit.util.Vector from, org.bukkit.util.Vector to)
public static boolean playerLooked(org.bukkit.Location from, org.bukkit.Location to)
public static boolean elapsed(long time, long needed)
public static long gcd(long a, long b)
public static long gcd(long... input)
public static float normalizeAngle(float yaw)
public static double normalizeAngle(double yaw)
public static float getAngleDelta(float one, float two)
public static long lcm(long a, long b)
public static long lcm(long... input)
public static float getDelta(float one, float two)
public static double getDelta(double one, double two)
public static long getDelta(long one, long two)
public static long getDelta(int one, int two)
public static long elapsed(long time)
public static double getHorizontalDistance(org.bukkit.Location from, org.bukkit.Location to)
public static int millisToTicks(long millis)
public static double getVerticalDistance(org.bukkit.Location from, org.bukkit.Location to)
public static int getDistanceToGround(org.bukkit.entity.Player p)
public static double trim(int degree, double d)
public static float trimFloat(int degree, float d)
public static double getYawDifference(org.bukkit.Location one, org.bukkit.Location two)
public static double round(double value, int places)
public static double round(double value, int places, java.math.RoundingMode mode)
public static double round(double value)
public static float round(float value, int places)
public static float round(float value, int places, java.math.RoundingMode mode)
public static float round(float value)
public static int floor(double var0)
public static float yawTo180F(float flub)
public static double yawTo180D(double dub)
public static double getDirection(org.bukkit.Location from, org.bukkit.Location to)
public static float[] getRotations(org.bukkit.Location one, org.bukkit.Location two)
public static float[] getRotations(org.bukkit.entity.LivingEntity origin, org.bukkit.entity.LivingEntity point)
public static boolean isLookingTowardsEntity(org.bukkit.Location from, org.bukkit.Location to, org.bukkit.entity.LivingEntity entity)
public static double[] getOffsetFromEntity(org.bukkit.entity.Player player, org.bukkit.entity.LivingEntity entity)
public static double[] getOffsetFromLocation(org.bukkit.Location one, org.bukkit.Location two)