public static void CalculateNewPosition(Leg leg, double distance, double direction, double yDistance) { double newX; double newZ; CalculateXandZ(direction, distance,leg.Side, leg.X, leg.Z, out newX, out newZ); leg.SetXYZ(newX, newZ, leg.Y - yDistance); }