@Test public void testIsPointInFront() { IHalfLine halfLine = HalfLine.fromDirection(Vector2f.ZERO_VECTOR, Vector2f.X_AXIS); IHalfLine invalidLine = HalfLine.fromDirection(Vector2f.ZERO_VECTOR, Vector2f.ZERO_VECTOR); for (int degAngle = 0; degAngle <= 360; degAngle++) { double radAngle = Math.toRadians(degAngle); IVector2 point = Vector2f.X_AXIS.turnToNew(radAngle); assertThat(halfLine.isPointInFront(point), is(degAngle <= 90 || degAngle > 270)); assertThat(invalidLine.isPointInFront(point), is(false)); } }
@Override public boolean isPointInFront(final IVector2 point) { return isValid() && LineMath.isPointInFront(this, point); }
HalfLine extends AUnboundedLine implements IHalfLine { @Override public boolean isPointInFront(final IVector2 point) { return isValid() && LineMath.isPointInFront(this, point); } }
HalfLine extends AUnboundedLine implements IHalfLine { @Override public boolean isPointInFront(final IVector2 point) { return isValid() && LineMath.isPointInFront(this, point); } private  HalfLine(final IVector2 supportVector, final IVector2 directionVector); }
HalfLine extends AUnboundedLine implements IHalfLine { @Override public boolean isPointInFront(final IVector2 point) { return isValid() && LineMath.isPointInFront(this, point); } private  HalfLine(final IVector2 supportVector, final IVector2 directionVector); static IHalfLine fromDirection(final IVector2 supportVector, final IVector2 directionVector); @Override boolean equals(final Object other); @Override int hashCode(); @Override IVector2 closestPointOnLine(final IVector2 point); @Override ILine toLine(); @Override IHalfLine copy(); @Override Optional<IVector2> intersectLine(final ILine line); @Override Optional<IVector2> intersectHalfLine(final IHalfLine other); @Override Optional<IVector2> intersectSegment(final ILineSegment segment); @Override boolean isPointInFront(final IVector2 point); @Override String toString(); }
HalfLine extends AUnboundedLine implements IHalfLine { @Override public boolean isPointInFront(final IVector2 point) { return isValid() && LineMath.isPointInFront(this, point); } private  HalfLine(final IVector2 supportVector, final IVector2 directionVector); static IHalfLine fromDirection(final IVector2 supportVector, final IVector2 directionVector); @Override boolean equals(final Object other); @Override int hashCode(); @Override IVector2 closestPointOnLine(final IVector2 point); @Override ILine toLine(); @Override IHalfLine copy(); @Override Optional<IVector2> intersectLine(final ILine line); @Override Optional<IVector2> intersectHalfLine(final IHalfLine other); @Override Optional<IVector2> intersectSegment(final ILineSegment segment); @Override boolean isPointInFront(final IVector2 point); @Override String toString();  }