- waypoints.push_back(wpt);
-
- accelDistance =
- ((vTakeoffMetric * 1.1) * (vTakeoffMetric * 1.1) -
- vTaxiMetric * vTaxiMetric) / (2 * accelMetric);
- //cerr << "Using " << accelDistance << " " << accelMetric << " " << vTakeoffMetric << endl;
- accelPoint = rwy->pointOnCenterline(105.0 + accelDistance);
- wpt =
- createOnGround(ac, "rotate", accelPoint, airportElev + 1000,
- vTakeoff * 1.1);
- wpt->on_ground = false;
- waypoints.push_back(wpt);
-
- wpt = cloneWithPos(ac, wpt, "3000 ft", rwy->end());
- wpt->altitude = airportElev + 3000;
- waypoints.push_back(wpt);
-
- // Finally, add two more waypoints, so that aircraft will remain under
- // Tower control until they have reached the 3000 ft climb point
- SGGeod pt = rwy->pointOnCenterline(5000 + rwy->lengthM() * 0.5);
- wpt = cloneWithPos(ac, wpt, "5000 ft", pt);
- wpt->altitude = airportElev + 5000;
- waypoints.push_back(wpt);
+ pushBackWaypoint(wpt);
+
+ double vRef = vTakeoffMetric + 20; // climb-out at v2 + 20kts
+ double gearUpDist = d + pitchDistance(INITIAL_PITCH_ANGLE, 400 * SG_FEET_TO_METER);
+ accelPoint = rwy->pointOnCenterline(gearUpDist);
+
+ wpt = cloneWithPos(ac, wpt, "gear-up", accelPoint);
+ wpt->setSpeed(vRef);
+ wpt->setCrossat(airportElev + 400);
+ wpt->setOn_ground(false);
+ wpt->setGear_down(false);
+ pushBackWaypoint(wpt);
+
+ double climbOut = d + pitchDistance(INITIAL_PITCH_ANGLE, 2000 * SG_FEET_TO_METER);
+ accelPoint = rwy->pointOnCenterline(climbOut);
+ wpt = createInAir(ac, "2000'", accelPoint, airportElev + 2000, vRef);
+ pushBackWaypoint(wpt);
+
+ // as soon as we pass 2000', hand off to departure so the next acft can line up
+ // ideally the next aircraft would be able to line-up + hold but that's tricky
+ // with the current design.