Ejemplo n.º 1
0
  /**
   * Test method for {@link
   * fr.nantes1900.models.basis.Edge#project(fr.nantes1900.models.basis.Point)} .
   */
  @Test
  public static final void testProject() {
    final Point pointTest0 = new Point(0, 0, 0);
    final Point pointTest1 = new Point(1, 0, 0);
    final Point pointTest2 = new Point(0.9, 0.1, 0);

    final Edge e1 = new Edge(pointTest0, pointTest1);

    Assert.assertTrue(e1.project(pointTest2).equals(new Point(0.9, 0, 0)));
  }
Ejemplo n.º 2
0
  /**
   * Test method for {@link
   * fr.nantes1900.models.basis.Edge#orientedAs(fr.nantes1900.models.basis.Edge, double)} .
   */
  @Test
  public static final void testOrientedAs() {
    final Point pointTest0 = new Point(0, 0, 0);
    final Point pointTest1 = new Point(1, 0, 0);
    final Point pointTest2 = new Point(1, 0.1, 0);

    final Edge e1 = new Edge(pointTest0, pointTest1);
    final Edge e2 = new Edge(pointTest2, pointTest0);

    Assert.assertTrue(e1.orientedAs(e2, 20));
    Assert.assertFalse(e1.orientedAs(e2, 2));
  }
Ejemplo n.º 3
0
  /**
   * Test method for {@link
   * fr.nantes1900.models.basis.Edge#isInCylinder3D(fr.nantes1900.models.basis.Point, double)} .
   */
  @Test
  public static final void testIsInCylinder3D() {
    final Point pointTest1 = new Point(0, 0, 0);
    final Point pointTest2 = new Point(1, 1, 1);
    final Edge e = new Edge(pointTest1, pointTest2);

    final Point pointTest3 = new Point(0, 0.5, 0.5);
    Assert.assertTrue(e.isInCylinder3D(pointTest3, 1));

    final Point pointTest4 = new Point(1.5, 1.5, 1.5);
    final Point pointTest5 = new Point(1, 3, 1);
    Assert.assertFalse(e.isInCylinder3D(pointTest4, 1));
    Assert.assertFalse(e.isInCylinder3D(pointTest5, 1));
  }