Java Graphics

Back to index

Your browser is broken ASSIGNMENT: The example displayed to the left demonstrates how to draw a circle without using the arc method. However, the thing to pay special attention to is how the diagonal rectangle gets drawn. You will notice that four points (each defined with an xy-coordinate pair) are created and linked using moveTo and lineTo.

If you can get to where you understand how the diagonal rectangle is drawn, then recreating the item to the right should not be too difficult. Use the method demonstrated to the left to recreate the item shown to the right. It should become obvious that the corners of the rectangle are just points along a circle which are connected with straight lines.