Package net.sf.latexdraw.glib.models.interfaces.shape

Examples of net.sf.latexdraw.glib.models.interfaces.shape.IPoint.computeAngle()


  @Test
  public void testComputeAngle() {
    IPoint pt1 = ShapeFactory.createPoint();

    assertEquals(Double.NaN, pt1.computeAngle(null), 0.1);
    assertEquals(0., pt1.computeAngle(ShapeFactory.createPoint(1,0)), 0.1);
    assertEquals(Math.PI/2., pt1.computeAngle(ShapeFactory.createPoint(0,1)), 0.1);
    assertEquals(Math.PI, pt1.computeAngle(ShapeFactory.createPoint(-1,0)), 0.1);
    assertEquals(3.*Math.PI/2., pt1.computeAngle(ShapeFactory.createPoint(0,-1)), 0.1);

View Full Code Here


  @Test
  public void testComputeAngle() {
    IPoint pt1 = ShapeFactory.createPoint();

    assertEquals(Double.NaN, pt1.computeAngle(null), 0.1);
    assertEquals(0., pt1.computeAngle(ShapeFactory.createPoint(1,0)), 0.1);
    assertEquals(Math.PI/2., pt1.computeAngle(ShapeFactory.createPoint(0,1)), 0.1);
    assertEquals(Math.PI, pt1.computeAngle(ShapeFactory.createPoint(-1,0)), 0.1);
    assertEquals(3.*Math.PI/2., pt1.computeAngle(ShapeFactory.createPoint(0,-1)), 0.1);

    pt1.setPoint(1, 1);
View Full Code Here

  public void testComputeAngle() {
    IPoint pt1 = ShapeFactory.createPoint();

    assertEquals(Double.NaN, pt1.computeAngle(null), 0.1);
    assertEquals(0., pt1.computeAngle(ShapeFactory.createPoint(1,0)), 0.1);
    assertEquals(Math.PI/2., pt1.computeAngle(ShapeFactory.createPoint(0,1)), 0.1);
    assertEquals(Math.PI, pt1.computeAngle(ShapeFactory.createPoint(-1,0)), 0.1);
    assertEquals(3.*Math.PI/2., pt1.computeAngle(ShapeFactory.createPoint(0,-1)), 0.1);

    pt1.setPoint(1, 1);
    assertEquals(0., pt1.computeAngle(ShapeFactory.createPoint(2,1)), 0.1);
View Full Code Here

    IPoint pt1 = ShapeFactory.createPoint();

    assertEquals(Double.NaN, pt1.computeAngle(null), 0.1);
    assertEquals(0., pt1.computeAngle(ShapeFactory.createPoint(1,0)), 0.1);
    assertEquals(Math.PI/2., pt1.computeAngle(ShapeFactory.createPoint(0,1)), 0.1);
    assertEquals(Math.PI, pt1.computeAngle(ShapeFactory.createPoint(-1,0)), 0.1);
    assertEquals(3.*Math.PI/2., pt1.computeAngle(ShapeFactory.createPoint(0,-1)), 0.1);

    pt1.setPoint(1, 1);
    assertEquals(0., pt1.computeAngle(ShapeFactory.createPoint(2,1)), 0.1);
    assertEquals(Math.PI/2., pt1.computeAngle(ShapeFactory.createPoint(1,2)), 0.1);
View Full Code Here

    assertEquals(Double.NaN, pt1.computeAngle(null), 0.1);
    assertEquals(0., pt1.computeAngle(ShapeFactory.createPoint(1,0)), 0.1);
    assertEquals(Math.PI/2., pt1.computeAngle(ShapeFactory.createPoint(0,1)), 0.1);
    assertEquals(Math.PI, pt1.computeAngle(ShapeFactory.createPoint(-1,0)), 0.1);
    assertEquals(3.*Math.PI/2., pt1.computeAngle(ShapeFactory.createPoint(0,-1)), 0.1);

    pt1.setPoint(1, 1);
    assertEquals(0., pt1.computeAngle(ShapeFactory.createPoint(2,1)), 0.1);
    assertEquals(Math.PI/2., pt1.computeAngle(ShapeFactory.createPoint(1,2)), 0.1);
    assertEquals(Math.PI, pt1.computeAngle(ShapeFactory.createPoint(0,1)), 0.1);
View Full Code Here

    assertEquals(Math.PI/2., pt1.computeAngle(ShapeFactory.createPoint(0,1)), 0.1);
    assertEquals(Math.PI, pt1.computeAngle(ShapeFactory.createPoint(-1,0)), 0.1);
    assertEquals(3.*Math.PI/2., pt1.computeAngle(ShapeFactory.createPoint(0,-1)), 0.1);

    pt1.setPoint(1, 1);
    assertEquals(0., pt1.computeAngle(ShapeFactory.createPoint(2,1)), 0.1);
    assertEquals(Math.PI/2., pt1.computeAngle(ShapeFactory.createPoint(1,2)), 0.1);
    assertEquals(Math.PI, pt1.computeAngle(ShapeFactory.createPoint(0,1)), 0.1);
    assertEquals(3.*Math.PI/2., pt1.computeAngle(ShapeFactory.createPoint(1,0)), 0.1);
  }

View Full Code Here

    assertEquals(Math.PI, pt1.computeAngle(ShapeFactory.createPoint(-1,0)), 0.1);
    assertEquals(3.*Math.PI/2., pt1.computeAngle(ShapeFactory.createPoint(0,-1)), 0.1);

    pt1.setPoint(1, 1);
    assertEquals(0., pt1.computeAngle(ShapeFactory.createPoint(2,1)), 0.1);
    assertEquals(Math.PI/2., pt1.computeAngle(ShapeFactory.createPoint(1,2)), 0.1);
    assertEquals(Math.PI, pt1.computeAngle(ShapeFactory.createPoint(0,1)), 0.1);
    assertEquals(3.*Math.PI/2., pt1.computeAngle(ShapeFactory.createPoint(1,0)), 0.1);
  }


View Full Code Here

    assertEquals(3.*Math.PI/2., pt1.computeAngle(ShapeFactory.createPoint(0,-1)), 0.1);

    pt1.setPoint(1, 1);
    assertEquals(0., pt1.computeAngle(ShapeFactory.createPoint(2,1)), 0.1);
    assertEquals(Math.PI/2., pt1.computeAngle(ShapeFactory.createPoint(1,2)), 0.1);
    assertEquals(Math.PI, pt1.computeAngle(ShapeFactory.createPoint(0,1)), 0.1);
    assertEquals(3.*Math.PI/2., pt1.computeAngle(ShapeFactory.createPoint(1,0)), 0.1);
  }


  @Test
View Full Code Here

    pt1.setPoint(1, 1);
    assertEquals(0., pt1.computeAngle(ShapeFactory.createPoint(2,1)), 0.1);
    assertEquals(Math.PI/2., pt1.computeAngle(ShapeFactory.createPoint(1,2)), 0.1);
    assertEquals(Math.PI, pt1.computeAngle(ShapeFactory.createPoint(0,1)), 0.1);
    assertEquals(3.*Math.PI/2., pt1.computeAngle(ShapeFactory.createPoint(1,0)), 0.1);
  }


  @Test
  public void testComputeRotationAngle() {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.