java affine transformations

J

Jeremy Watts

hi Roedy,

tried some of the code on your site, this snippet:-

"import java.awt.geom.AffineTransform;
....

// transform that shifts points 10 right and 20 up
AffineTransform transformer = AffineTransform.getTranslateInstance
( 10.0d, -20.0d );

// create point
Point2D before = new Point2D.Double( 3.0d , 6.0d );

// create point to hold result
Point2D after = new Point2D.Double();

// transform the point
after = transformer.transform ( before, after );

// prints 13.0,-14.0
System.out.println( after.getX() + "," + after.getY() );"



but it seems to throw an error for the line :-
"// create point
Point2D before = new Point2D.Double( 3.0d , 6.0d );"

it says 'cannot find symbol - class Point2D' . whats going on here?

jeremy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top