All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----gerken.vehicles.Location
A Location represents a position of a SimulationParticipant using two double values (x and y). A Location is able to
This software is provided on an as-is basis and is copyright Chris Gerken. The only rights granted to you are to enjoy and learn from this software.
Return a Location object representing coordinates (x,y).
Compute and return a Location that results from moving away from the receiver for a distance of length at an angle of angle
Calculate and return the distance from this location to Location l
Return the distance from the receiver to the origin.
Return the X value as an double
Return the Y value as an double
Return the X value as an integer
Return the Y value as an integer
Return a text representation of the receiver.
public Location(double x,
double y)
Return a Location object representing coordinates (x,y).
public void addPolar(double angle,
double length)
Compute and return a Location that results from moving away from the receiver for a distance of length at an angle of angle
public double distanceFrom(Location l)
Calculate and return the distance from this location to Location l
public double getVectorLength()
Return the distance from the receiver to the origin.
public double getX()
Return the X value as an double
public double getY()
Return the Y value as an double
public int intX()
Return the X value as an integer
public int intY()
Return the Y value as an integer
public String toString()
Return a text representation of the receiver.
All Packages Class Hierarchy This Package Previous Next Index