assert tMax >= t0: "sMax=" + sMax + ", " + this.toString();
	public TrainPathSegment(float t0, float v0, float a, float s0, float		sMax) {	    this.t0 = t0;	    this.v0 = v0;	    // when a is small, approximate to 0 to avoid problems with	    // taking the difference between two small numbers	    if (Math.abs(a) > 0.0001)		this.a = a;	    else		this.a = 0.0f;	    this.s0 = s0;	    float deltaS = sMax - s0;	    // (-b +- sqrt(b^2 - 4ac)) / 2a	    if (a == 0.0f) {		tMax = t0 + (sMax - s0) / v0;	    } else if (v0 * v0 + 2.0f * a * deltaS < 0.0f) {		tMax = -1;	    } else {		tMax = t0 + (-v0 + (float) Math.sqrt(v0 * v0 + 2.0f * a * 			    deltaS)) / a;	    }	    assert tMax >= t0: "sMax=" + sMax + ", " + this.toString();	}