/** * Internal. Compute one rock curve segment and don't change internal state. * * @param i16 which rock * @param t0 starttime * @param sweepFactor * @return the new Curve in world coordinates. */ CurveRock<Pos> doComputeCurve( final int i16, final double t0, final RockSet<Pos> p, final RockSet<Vel> s, final double sweepFactor) { final Rock<Pos> x = p.getRock(i16); final Rock<Vel> v = s.getRock(i16); final CurveRock<Pos> wc; if (v.p().distanceSq(0, 0) == 0) wc = CurveStill.newInstance(x); else // Convert the initial angle from WC to RC. // TUNE 2x sqrt, 2x atan2 to 1x each? wc = new CurveTransformed<Pos>( curler.computeRc( x.getA() + Math.atan2(v.getX(), v.getY()), MathVec.abs2D(v.p()), v.getA(), sweepFactor), CurveTransformed.createRc2Wc(x.p(), v.p(), null), t0); if (log.isDebugEnabled()) log.debug(i16 + " " + wc); return wc; }