@Test public void testNewWithoutCopy() { IVector2 sV = Vector2.fromXY(1, 2); IVector2 positiveDV = Vector2.fromAngle(1.5d); IVector2 negativeDV = Vector2.fromAngle(-1.5d); ILine posLine = Line.createNewWithoutCopy(sV, positiveDV); assertThat(posLine.supportVector(), is(sV)); assertThat(posLine.directionVector(), is(positiveDV)); ILine negativeLine = Line.createNewWithoutCopy(sV, negativeDV); assertThat(negativeLine.supportVector(), is(sV)); assertThat(negativeLine.directionVector(), is(negativeDV.multiplyNew(-1.0d))); }
static ILine createNewWithoutCopy(final IVector2 supportVector, final IVector2 directionVector) { IVector2 dV = directionVector; if (dV.getAngle(0.0d) < 0.0d) { dV = dV.multiplyNew(-1.0d); } return new Line(supportVector, dV); }
Line extends AUnboundedLine implements ILine { static ILine createNewWithoutCopy(final IVector2 supportVector, final IVector2 directionVector) { IVector2 dV = directionVector; if (dV.getAngle(0.0d) < 0.0d) { dV = dV.multiplyNew(-1.0d); } return new Line(supportVector, dV); } }
Line extends AUnboundedLine implements ILine { static ILine createNewWithoutCopy(final IVector2 supportVector, final IVector2 directionVector) { IVector2 dV = directionVector; if (dV.getAngle(0.0d) < 0.0d) { dV = dV.multiplyNew(-1.0d); } return new Line(supportVector, dV); } private  Line(final IVector2 supportVector, final IVector2 directionVector); }
Line extends AUnboundedLine implements ILine { static ILine createNewWithoutCopy(final IVector2 supportVector, final IVector2 directionVector) { IVector2 dV = directionVector; if (dV.getAngle(0.0d) < 0.0d) { dV = dV.multiplyNew(-1.0d); } return new Line(supportVector, dV); } private  Line(final IVector2 supportVector, final IVector2 directionVector); static ILine fromPoints(final IVector2 supportPointA, final IVector2 supportPointB); static ILine fromDirection(final IVector2 supportVector, final IVector2 directionVector); @Override ILine copy(); @Override final boolean equals(final Object other); @Override final int hashCode(); @Override Optional<Double> getYIntercept(); @Override Optional<Double> getXValue(final double y); @Override Optional<Double> getYValue(final double x); @Override ILine getOrthogonalLine(); @Override IVector2 closestPointOnLine(final IVector2 point); @Override ILine toLine(); @Override Optional<IVector2> intersectLine(final ILine other); @Override Optional<IVector2> intersectHalfLine(final IHalfLine halfLine); @Override Optional<IVector2> intersectSegment(final ILineSegment segment); @Override String toString(); }
Line extends AUnboundedLine implements ILine { static ILine createNewWithoutCopy(final IVector2 supportVector, final IVector2 directionVector) { IVector2 dV = directionVector; if (dV.getAngle(0.0d) < 0.0d) { dV = dV.multiplyNew(-1.0d); } return new Line(supportVector, dV); } private  Line(final IVector2 supportVector, final IVector2 directionVector); static ILine fromPoints(final IVector2 supportPointA, final IVector2 supportPointB); static ILine fromDirection(final IVector2 supportVector, final IVector2 directionVector); @Override ILine copy(); @Override final boolean equals(final Object other); @Override final int hashCode(); @Override Optional<Double> getYIntercept(); @Override Optional<Double> getXValue(final double y); @Override Optional<Double> getYValue(final double x); @Override ILine getOrthogonalLine(); @Override IVector2 closestPointOnLine(final IVector2 point); @Override ILine toLine(); @Override Optional<IVector2> intersectLine(final ILine other); @Override Optional<IVector2> intersectHalfLine(final IHalfLine halfLine); @Override Optional<IVector2> intersectSegment(final ILineSegment segment); @Override String toString();  }