Write an applet that draws the rectangles (use fillPolygon() function) turned by angle
ALPHA relatively to the previous rectangle. Center of rotation is a one corner of a rectangle. ALPHA is equal to 20 degree, one side of rectangle is equal to 30 and other side is equal to 50. Amount of rectangles is equal to 18.
Please i need help in calculating coordinates of rectangle corners for fillPolygon function
unfortunately my trigonometry is very poor. and i dont have even any idea how to find these corners
i attach link for my homework it is Task2. Thanks for help
You’ll need to perform a
rotatetransformation. Each class extending the abstract classGraphics2Dimplements a method like this.Just insert appropriate code in the
paintmethod of your applet. You’ll need a combination ofdrawRect(orfillPolygonas your teacher wishes),translateandrotatemethods.Check out the javadoc http://docs.oracle.com/javase/1.4.2/docs/api/java/awt/Graphics2D.html#rotate%28double%29