aim4.map.track
Class LineTrack.Position

java.lang.Object
  extended by aim4.map.track.LineTrack.Position
All Implemented Interfaces:
TrackPosition
Enclosing class:
LineTrack

public class LineTrack.Position
extends Object
implements TrackPosition

A position on this track.


Constructor Summary
LineTrack.Position(double dist)
          Create a position object at the given distance from the starting waypoint on this track
 
Method Summary
 double getTangentSlope()
          Get the slope of the tangent at the location.
 double getX()
          Get the x-coordinate of the current position.
 double getY()
          Get the y-coordinate of the current position.
 double move(double dist)
          Move the position by a certain distance on the track but not beyond the end waypoint.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LineTrack.Position

public LineTrack.Position(double dist)
Create a position object at the given distance from the starting waypoint on this track

Parameters:
dist - the distance
Method Detail

getX

public double getX()
Get the x-coordinate of the current position.

Specified by:
getX in interface TrackPosition
Returns:
the x-coordinate of the current position.

getY

public double getY()
Get the y-coordinate of the current position.

Specified by:
getY in interface TrackPosition
Returns:
the y-coordinate of the current position.

getTangentSlope

public double getTangentSlope()
Get the slope of the tangent at the location.

Specified by:
getTangentSlope in interface TrackPosition
Returns:
The slope of the tangent at the location.

move

public double move(double dist)
Move the position by a certain distance on the track but not beyond the end waypoint. Return the remaining distance if it moves beyond the end waypoint.

Specified by:
move in interface TrackPosition
Parameters:
dist - the distance
Returns:
the remaining distance of the traversal; exactly 0 (that can be tested with "== 0.0") if the traversal has not reached the end waypoint.

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2011. All Rights Reserved.