@Test public void testGetYIntercept() { Vector2 vecS = Vector2.fromXY(1, 1); Vector2 vecD = Vector2.fromXY(1, 1); Line line1 = Line.fromDirection(vecS, vecD); assertThat(line1.getYIntercept().isPresent(), is(true)); assertThat(line1.getYIntercept().get(), IsCloseTo.closeTo(0.0, 1e-6)); vecS = Vector2.fromXY(3, 4); vecD = Vector2.fromXY(0, 1); line1 = Line.fromDirection(vecS, vecD); assertThat(line1.getYIntercept().isPresent(), is(false)); vecS = Vector2.fromXY(-11, 1); vecD = Vector2.fromXY(-3, 0); line1 = Line.fromDirection(vecS, vecD); assertThat(line1.getYIntercept().isPresent(), is(true)); assertThat(line1.getYIntercept().get(), IsCloseTo.closeTo(1.0, 1e-6)); vecS = Vector2.fromXY(-9, 1); vecD = Vector2.fromXY(-3, 0.5); line1 = Line.fromDirection(vecS, vecD); assertThat(line1.getYIntercept().isPresent(), is(true)); assertThat(line1.getYIntercept().get(), IsCloseTo.closeTo(-0.5, 1e-6)); }
public static Line fromDirection(final IVector2 supportVector, final IVector2 directionVector) { return new Line(supportVector, directionVector); }
Line extends ALine { public static Line fromDirection(final IVector2 supportVector, final IVector2 directionVector) { return new Line(supportVector, directionVector); } }
Line extends ALine { public static Line fromDirection(final IVector2 supportVector, final IVector2 directionVector) { return new Line(supportVector, directionVector); } @SuppressWarnings("unused") private  Line(); private  Line(final IVector2 sV, final IVector2 dV); protected  Line(final ILine line); }
Line extends ALine { public static Line fromDirection(final IVector2 supportVector, final IVector2 directionVector) { return new Line(supportVector, directionVector); } @SuppressWarnings("unused") private  Line(); private  Line(final IVector2 sV, final IVector2 dV); protected  Line(final ILine line); static Line fromPoints(final IVector2 pFrom, final IVector2 pTo); static Line fromDirection(final IVector2 supportVector, final IVector2 directionVector); @SuppressWarnings("squid:S1166") // Exception from solver not logged static Optional<Line> fromPointsList(final List<IVector2> points); static Line copyOf(final ILine line); @Override IVector2 supportVector(); @Override IVector2 directionVector(); @Override final boolean equals(final Object o); @Override final int hashCode(); @Override String toString(); }
Line extends ALine { public static Line fromDirection(final IVector2 supportVector, final IVector2 directionVector) { return new Line(supportVector, directionVector); } @SuppressWarnings("unused") private  Line(); private  Line(final IVector2 sV, final IVector2 dV); protected  Line(final ILine line); static Line fromPoints(final IVector2 pFrom, final IVector2 pTo); static Line fromDirection(final IVector2 supportVector, final IVector2 directionVector); @SuppressWarnings("squid:S1166") // Exception from solver not logged static Optional<Line> fromPointsList(final List<IVector2> points); static Line copyOf(final ILine line); @Override IVector2 supportVector(); @Override IVector2 directionVector(); @Override final boolean equals(final Object o); @Override final int hashCode(); @Override String toString();  }