java.lang.Object
net.botwithus.rs3.game.Distance
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
between
(double x1, double y1, double x2, double y2) Gets the euclidean distance between the two sets of (x,y) points.static double
static double
Gets the distance between two Locatable entities that exist on the world graph.static double
Gets the euclidean distance between the local player and assuming they're on the same plane/z-level.
-
Constructor Details
-
Distance
public Distance()
-
-
Method Details
-
between
Gets the distance between two Locatable entities that exist on the world graph. If either Locatable is not on the world graph or they're on different Z levels, the method returns Double.NaN.- Parameters:
first
- a non-null Locatable on the world graph.second
- a different non-null Locatable on the world graph.- Returns:
- The distance between the two Locatables, or Double.NaN if either Locatable is not on the world graph or they're on different Z levels.
-
between
-
between
public static double between(double x1, double y1, double x2, double y2) Gets the euclidean distance between the two sets of (x,y) points.- Parameters:
x1
- The x-coordinate of the first point.y1
- The y-coordinate of the first point.x2
- The x-coordinate of the second point.y2
- The y-coordinate of the second point.- Returns:
- The Euclidean distance between the two points.
-
to
Gets the euclidean distance between the local player and assuming they're on the same plane/z-level.- Parameters:
other
- A locatable that exists on the world graph.- Returns:
- The euclidean distance between the local player and in 2d space, or Double.NaN if it can't be determined.
-