@Test public void testGetMinimumDistanceSimple() { IVector2 initialPos = Vector2.fromXY(0, 0); IVector2 finalPos = Vector2.fromXY(3, 0); IVector2 initialVel = Vector2f.ZERO_VECTOR; IVector2 testPoint = Vector2.fromXY(1.5, 1); BangBangTrajectory2D traj = new BangBangTrajectory2D(initialPos, finalPos, initialVel, 2, 3); double dist = traj.getPlanarCurve().getMinimumDistanceToPoint(testPoint); assertThat(dist).isCloseTo(1.0, within(1e-6)); }
public double getMinimumDistanceToPoint(final IVector2 point) { return getMinimumDistanceToCurve(PlanarCurve.fromPoint(point)); }
PlanarCurve { public double getMinimumDistanceToPoint(final IVector2 point) { return getMinimumDistanceToCurve(PlanarCurve.fromPoint(point)); } }
PlanarCurve { public double getMinimumDistanceToPoint(final IVector2 point) { return getMinimumDistanceToCurve(PlanarCurve.fromPoint(point)); } PlanarCurve(final List<PlanarCurveSegment> segments); }
PlanarCurve { public double getMinimumDistanceToPoint(final IVector2 point) { return getMinimumDistanceToCurve(PlanarCurve.fromPoint(point)); } PlanarCurve(final List<PlanarCurveSegment> segments); List<PlanarCurveSegment> getSegments(); double getTEnd(); static PlanarCurve fromPoint(final IVector2 point); static PlanarCurve fromPositionAndVelocity(final IVector2 pos, final IVector2 vel, final double tEnd); static PlanarCurve fromPositionVelocityAndAcceleration(final IVector2 pos, final IVector2 vel,
			final IVector2 acc, final double tEnd); PlanarCurve restrictToEnd(final double tEnd); PlanarCurve restrictToStart(final double tStart); double getMinimumDistanceToPoint(final IVector2 point); double getMinimumDistanceToCurve(final PlanarCurve curve); List<IVector2> getIntersectionsWithLineSegment(final ILine line); List<IVector2> getIntersectionsWithRectangle(final IRectangle rect); }
PlanarCurve { public double getMinimumDistanceToPoint(final IVector2 point) { return getMinimumDistanceToCurve(PlanarCurve.fromPoint(point)); } PlanarCurve(final List<PlanarCurveSegment> segments); List<PlanarCurveSegment> getSegments(); double getTEnd(); static PlanarCurve fromPoint(final IVector2 point); static PlanarCurve fromPositionAndVelocity(final IVector2 pos, final IVector2 vel, final double tEnd); static PlanarCurve fromPositionVelocityAndAcceleration(final IVector2 pos, final IVector2 vel,
			final IVector2 acc, final double tEnd); PlanarCurve restrictToEnd(final double tEnd); PlanarCurve restrictToStart(final double tStart); double getMinimumDistanceToPoint(final IVector2 point); double getMinimumDistanceToCurve(final PlanarCurve curve); List<IVector2> getIntersectionsWithLineSegment(final ILine line); List<IVector2> getIntersectionsWithRectangle(final IRectangle rect);  }