@Test public void testGetMaximumDistanceToOverChip() { double dist = consultant.getMaximumDistanceToOverChip(3.0, 150); assertEquals(dist, 728.5402049514264, 1e-6); dist = consultant.getMaximumDistanceToOverChip(1.0, 10000); assertEquals(0, dist, 1e-9); }
@Override public double getMaximumDistanceToOverChip(final double initVel, final double height) { final double g = 9.81; double heightInM = height * 0.001; IVector2 kickVel = absoluteKickVelToVector(initVel); double velZ = kickVel.y(); double maxHeight = (velZ * velZ) / (2.0 * g); if (heightInM > maxHeight) { return 0; } double tHeight = (SumatraMath.sqrt((velZ * velZ) - (2.0 * g * heightInM)) + velZ) / g; return kickVel.x() * tHeight * 1000.0; }
FixedLossPlusRollingConsultant implements IChipBallConsultant { @Override public double getMaximumDistanceToOverChip(final double initVel, final double height) { final double g = 9.81; double heightInM = height * 0.001; IVector2 kickVel = absoluteKickVelToVector(initVel); double velZ = kickVel.y(); double maxHeight = (velZ * velZ) / (2.0 * g); if (heightInM > maxHeight) { return 0; } double tHeight = (SumatraMath.sqrt((velZ * velZ) - (2.0 * g * heightInM)) + velZ) / g; return kickVel.x() * tHeight * 1000.0; } }
FixedLossPlusRollingConsultant implements IChipBallConsultant { @Override public double getMaximumDistanceToOverChip(final double initVel, final double height) { final double g = 9.81; double heightInM = height * 0.001; IVector2 kickVel = absoluteKickVelToVector(initVel); double velZ = kickVel.y(); double maxHeight = (velZ * velZ) / (2.0 * g); if (heightInM > maxHeight) { return 0; } double tHeight = (SumatraMath.sqrt((velZ * velZ) - (2.0 * g * heightInM)) + velZ) / g; return kickVel.x() * tHeight * 1000.0; } FixedLossPlusRollingConsultant(final FixedLossPlusRollingParameters params); }
FixedLossPlusRollingConsultant implements IChipBallConsultant { @Override public double getMaximumDistanceToOverChip(final double initVel, final double height) { final double g = 9.81; double heightInM = height * 0.001; IVector2 kickVel = absoluteKickVelToVector(initVel); double velZ = kickVel.y(); double maxHeight = (velZ * velZ) / (2.0 * g); if (heightInM > maxHeight) { return 0; } double tHeight = (SumatraMath.sqrt((velZ * velZ) - (2.0 * g * heightInM)) + velZ) / g; return kickVel.x() * tHeight * 1000.0; } FixedLossPlusRollingConsultant(final FixedLossPlusRollingParameters params); @Override IVector2 absoluteKickVelToVector(final double vel); @Override double botVelocityToChipFartherThanMaximumDistance(final double distance, final int numTouchdowns,
			final double absMaxVel); void setChipAngle(final double chipAngle); @Override FixedLossPlusRollingConsultant withChipAngle(final double chipAngle); @Override double getInitVelForDistAtTouchdown(final double distance, final int numTouchdown); @Override double getInitVelForPeakHeight(final double height); @Override double getMinimumDistanceToOverChip(final double initVel, final double height); @Override double getMaximumDistanceToOverChip(final double initVel, final double height); @Override double getTimeForKick(final double distance, final double kickSpeed); @Override double getVelForKick(final double distance, final double kickSpeed); }
FixedLossPlusRollingConsultant implements IChipBallConsultant { @Override public double getMaximumDistanceToOverChip(final double initVel, final double height) { final double g = 9.81; double heightInM = height * 0.001; IVector2 kickVel = absoluteKickVelToVector(initVel); double velZ = kickVel.y(); double maxHeight = (velZ * velZ) / (2.0 * g); if (heightInM > maxHeight) { return 0; } double tHeight = (SumatraMath.sqrt((velZ * velZ) - (2.0 * g * heightInM)) + velZ) / g; return kickVel.x() * tHeight * 1000.0; } FixedLossPlusRollingConsultant(final FixedLossPlusRollingParameters params); @Override IVector2 absoluteKickVelToVector(final double vel); @Override double botVelocityToChipFartherThanMaximumDistance(final double distance, final int numTouchdowns,
			final double absMaxVel); void setChipAngle(final double chipAngle); @Override FixedLossPlusRollingConsultant withChipAngle(final double chipAngle); @Override double getInitVelForDistAtTouchdown(final double distance, final int numTouchdown); @Override double getInitVelForPeakHeight(final double height); @Override double getMinimumDistanceToOverChip(final double initVel, final double height); @Override double getMaximumDistanceToOverChip(final double initVel, final double height); @Override double getTimeForKick(final double distance, final double kickSpeed); @Override double getVelForKick(final double distance, final double kickSpeed);  }