Question: using Java Swings Problem Description Draw a circle with three random points on the circle. Connect the points to form a triangle. Display the angles

using Java Swings Problem Description Draw a circle with three random pointson the circle. Connect the points to form a triangle. Display theusing Java Swings

Problem Description Draw a circle with three random points on the circle. Connect the points to form a triangle. Display the angles in the triangle. Use the mouse to drag a point along the perimeter of the circle. As you drag it, the triangle and angles are redisplayed dynamically as shown in Figure 1. You will need to create a Draw Triangle class (not main class) which takes some appropriate parameters in one of its methods to draw the triangle within the circle as shown in Figure 1. Your will not get full marks if DrawTriangle class is not created nor used as it as part of Object-Oriented Software Development. 50 65 SS Figure 1: Sample output Here is the formula to compute angles: x2, y2 A = acos((a+a -DD-etc) / (-2+bc) B = acos ( DD - a* a - cc) / 1-2 * a? c)) C = acos ( CC -bb-a.a)/(-2+ ab) B c A x3, y3 b x1, y1 Note, acos(x) is cos (x) What to submit: Submit the 5 screenshots of the output along with a check list of the following steps using this word document and full NetBeans Project folder. Note, your project should be developed using NetBeans otherwise your work will not be marked. Copy and paste your code into this word document too. Put this word document in your NetBeans project folder and then zip before submission Your code: 1. Can your program display a circle in the centre of the frame, if not, why? Write your answer here: 2. Can your program display three points on the circle, if not, why? Write your answer here: 3. Can your program draw a triangle using these three points, if not, why? Write your answer here: 4. Can your program compute the angles in the triangle, if not, why? Write your answer here: 5. Can your program display the angles in the triangle, if not, why? Write your answer here: 6. Note that three points are three small circles. Can your program detect which small circle is pressed by the mouse, if not, why? Write your answer here: 7. Can your program drag a small circle that has been pressed, if not, why? Write your answer here: 8. Can your program drag a small circle along the perimeter of the circle, if not, why? (Hint: Ignore the mouse drag if it is not along the perimeter of the circle.) Write your answer here

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!