Search in sources :

Example 21 with ILine

use of net.sf.latexdraw.models.interfaces.shape.ILine in project latexdraw by arnobl.

the class TestILine method testGetIntersectionVert.

@Test
public void testGetIntersectionVert() {
    ILine line2 = ShapeFactory.INST.createLine(0, 0, 1, 0);
    line.setLine(0, -10, 0, 10);
    line.updateAandB();
    IPoint pt = line.getIntersection(line2);
    assertNotNull(pt);
    assertEqualsDouble(0d, pt.getX());
    assertEqualsDouble(0d, pt.getY());
}
Also used : ILine(net.sf.latexdraw.models.interfaces.shape.ILine) IPoint(net.sf.latexdraw.models.interfaces.shape.IPoint) Test(org.junit.Test) HelperTest(net.sf.latexdraw.HelperTest)

Aggregations

ILine (net.sf.latexdraw.models.interfaces.shape.ILine)21 IPoint (net.sf.latexdraw.models.interfaces.shape.IPoint)10 Test (org.junit.Test)10 HelperTest (net.sf.latexdraw.HelperTest)7 Theory (org.junit.experimental.theories.Theory)4 LinearGradient (javafx.scene.paint.LinearGradient)1 Stop (javafx.scene.paint.Stop)1 Rotate (javafx.scene.transform.Rotate)1 IArrow (net.sf.latexdraw.models.interfaces.shape.IArrow)1 SVGMarkerElement (net.sf.latexdraw.parsers.svg.SVGMarkerElement)1