org.dartra.util
Class LocationTools

java.lang.Object
  extended byorg.dartra.util.LocationTools

public class LocationTools
extends java.lang.Object

This class provides tools for working with locations (x-y tuples).

Author:
Maarten De Cock

Method Summary
static double getAngle(double x1, double y1, double x2, double y2)
          Returns the angle from location (x1, y1) to location (x2, y2).
static double getDistance(double x1, double y1, double x2, double y2)
          Returns the distance between the locations (x1, y1) and (x2, y2).
static Location getLocation(double x, double y, double angle, double distance)
          Returns the Location at the given angle and distance from the given Location (x1, y1).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDistance

public static double getDistance(double x1,
                                 double y1,
                                 double x2,
                                 double y2)

Returns the distance between the locations (x1, y1) and (x2, y2).


getAngle

public static double getAngle(double x1,
                              double y1,
                              double x2,
                              double y2)

Returns the angle from location (x1, y1) to location (x2, y2).


getLocation

public static Location getLocation(double x,
                                   double y,
                                   double angle,
                                   double distance)

Returns the Location at the given angle and distance from the given Location (x1, y1).