Implement the following Java methods to create a Ying-Yang symbol (Programming Exercise 2.7) and a spirograph as Shape objects. public class Project2 {
public static Shape createYingYang()
public static Shape createSpirograph()
}
The spirograph is defined by the parametric equation:
x=(rl+r2)cost - pcos((1+72)t) y =(rl+r2)sint-psin((1+22)) where rl = 30, r2 = 40, p = 60, Osts 87
Use constructive area geometry to create the Ying-Yang. Use a Path2D.Double object (with the even-odd winding rule) to construct the spirograph with 1000 line segments. Both Shape objects are centered at the origin with dimensions approximately 200 by 200.

Solved
Show answers

Ask an AI advisor a question