Class Coord


  • public class Coord
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      Coord()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static float distanceTo2DHypotenuse​(net.runelite.api.coords.WorldPoint origin, net.runelite.api.coords.WorldPoint target)
      Find the straight-line distance from this point to another point.
      static float distanceToHypotenuse​(net.runelite.api.coords.WorldPoint origin, net.runelite.api.coords.WorldPoint target)
      Gets the straight-line distance between the origin point and the target point.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Coord

        public Coord()
    • Method Detail

      • distanceToHypotenuse

        public static float distanceToHypotenuse​(net.runelite.api.coords.WorldPoint origin,
                                                 net.runelite.api.coords.WorldPoint target)
        Gets the straight-line distance between the origin point and the target point.

        If the target is not on the same plane, this method will return Float.MAX_VALUE. If ignoring the plane is wanted, use the distanceTo2DHypotenuse(WorldPoint, WorldPoint) method.

        Parameters:
        origin - Start worldpoint
        target - End worldpoint
        Returns:
        the straight-line distance
      • distanceTo2DHypotenuse

        public static float distanceTo2DHypotenuse​(net.runelite.api.coords.WorldPoint origin,
                                                   net.runelite.api.coords.WorldPoint target)
        Find the straight-line distance from this point to another point.

        This method disregards the plane value of the two tiles and returns the simple distance between the X-Y coordinate pairs.

        Parameters:
        origin - Start worldpoint
        target - End worldpoint
        Returns:
        the straight-line distance