jfreerails.world.train
Interface SpeedAgainstTime

All Superinterfaces:
FreerailsSerializable, java.io.Serializable
All Known Implementing Classes:
CompositeSpeedAgainstTime, ConstAcc

public interface SpeedAgainstTime
extends FreerailsSerializable


Method Summary
 double calcA(double t)
           
 double calcS(double t)
          Returns the distance travelled at time t.
 double calcT(double s)
          Returns the time taken to travel distance s.
 double calcV(double t)
           
 double getS()
           
 double getT()
           
 

Method Detail

calcS

double calcS(double t)
Returns the distance travelled at time t. The returned value, s, satisfies the following conditions:
  1. s >= 0
  2. s <= getS()
  3. s = 0 if t = 0
  4. s = getS() if t = getT()

Returns:
s
Throws:
java.lang.IllegalArgumentException - iff t < 0 or t > getT()

calcT

double calcT(double s)
Returns the time taken to travel distance s. The returned value, t, satisfies the following conditions:
  1. t >= 0
  2. t <= getT()
  3. t = 0 if s = 0
  4. t = getT() if s = getS()

Returns:
t
Throws:
java.lang.IllegalArgumentException - iff s < 0 or s > getS()

calcV

double calcV(double t)
Throws:
java.lang.IllegalArgumentException - iff t < 0 or t > getT()

calcA

double calcA(double t)
Throws:
java.lang.IllegalArgumentException - iff t < 0 or t > getT()

getT

double getT()
Returns:
The time taken to travel the distance given by getS().

getS

double getS()
Returns:
The distance traveled during at time given by getT().