Package purrpackagedemo.Transformation

Examples of purrpackagedemo.Transformation.Rotation.apply()


    Translation t = new Translation( 3, -2.5 );
    assertPointEquals( new Point( 3, -2.5 ), t.apply( Point.ORIGIN ));
    assertPointEquals( new Point( 4, -1.5 ), t.apply( new Point( 1, 1 ) ) );
   
    Rotation r = new Rotation( Math.PI / 2.0 );
    assertPointEquals( new Point( 0, 1 ), r.apply( new Point( 1, 0 )) );
    assertPointEquals( new Point( -2, 0 ), r.apply( r.apply( new Point( 2, 0 ))) );
   
    Expansion z = new Expansion( -2 );
    assertPointEquals( new Point( 14, -16 ), z.apply( new Point( -7, 8 )) );
  }
View Full Code Here


    assertPointEquals( new Point( 3, -2.5 ), t.apply( Point.ORIGIN ));
    assertPointEquals( new Point( 4, -1.5 ), t.apply( new Point( 1, 1 ) ) );
   
    Rotation r = new Rotation( Math.PI / 2.0 );
    assertPointEquals( new Point( 0, 1 ), r.apply( new Point( 1, 0 )) );
    assertPointEquals( new Point( -2, 0 ), r.apply( r.apply( new Point( 2, 0 ))) );
   
    Expansion z = new Expansion( -2 );
    assertPointEquals( new Point( 14, -16 ), z.apply( new Point( -7, 8 )) );
  }
View Full Code Here

    assertPointEquals( new Point( 3, -2.5 ), t.apply( Point.ORIGIN ));
    assertPointEquals( new Point( 4, -1.5 ), t.apply( new Point( 1, 1 ) ) );
   
    Rotation r = new Rotation( Math.PI / 2.0 );
    assertPointEquals( new Point( 0, 1 ), r.apply( new Point( 1, 0 )) );
    assertPointEquals( new Point( -2, 0 ), r.apply( r.apply( new Point( 2, 0 ))) );
   
    Expansion z = new Expansion( -2 );
    assertPointEquals( new Point( 14, -16 ), z.apply( new Point( -7, 8 )) );
  }
View Full Code Here

 
  @Test
  public void testAccidentally() {
    Point p = new Point( 0, -1 );
    Rotation r = new Rotation( Math.PI / 2);
    System.out.println( r.apply( p ));
   

  }

}
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.