@Test public void testIsValid() { IVector2 sV = Vector2.fromXY(1, 2); IVector2 dV = Vector2.fromAngle(1.5d); IHalfLine validLine = HalfLine.fromDirection(sV, dV); assertThat(validLine.isValid(), is(true)); IHalfLine invalidLine = HalfLine.fromDirection(sV, Vector2f.ZERO_VECTOR); assertThat(invalidLine.isValid(), is(false)); }
public static IHalfLine fromDirection(final IVector2 supportVector, final IVector2 directionVector) { IVector2 sV = Vector2.copy(supportVector); IVector2 dV = directionVector.normalizeNew(); return createNewWithoutCopy(sV, dV); }
HalfLine extends AUnboundedLine implements IHalfLine { public static IHalfLine fromDirection(final IVector2 supportVector, final IVector2 directionVector) { IVector2 sV = Vector2.copy(supportVector); IVector2 dV = directionVector.normalizeNew(); return createNewWithoutCopy(sV, dV); } }
HalfLine extends AUnboundedLine implements IHalfLine { public static IHalfLine fromDirection(final IVector2 supportVector, final IVector2 directionVector) { IVector2 sV = Vector2.copy(supportVector); IVector2 dV = directionVector.normalizeNew(); return createNewWithoutCopy(sV, dV); } private  HalfLine(final IVector2 supportVector, final IVector2 directionVector); }
HalfLine extends AUnboundedLine implements IHalfLine { public static IHalfLine fromDirection(final IVector2 supportVector, final IVector2 directionVector) { IVector2 sV = Vector2.copy(supportVector); IVector2 dV = directionVector.normalizeNew(); return createNewWithoutCopy(sV, dV); } 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 { public static IHalfLine fromDirection(final IVector2 supportVector, final IVector2 directionVector) { IVector2 sV = Vector2.copy(supportVector); IVector2 dV = directionVector.normalizeNew(); return createNewWithoutCopy(sV, dV); } 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();  }