Question: Please write in Java & use the STDDraw class in the code. Example inputs for STDDraw: void line (double x0, double y0, double x1,double y1)
Please write in Java & use the STDDraw class in the code. Example inputs for STDDraw:
void line (double x0, double y0, double x1,double y1)
void point (double x, double y)
static void square(double x, double y, double r)
Draw a Spirograph which is a curve that is formed rolling a curve inside or outside of another circle. The trick to drawing such a curve is to place the pen at any point on the rolling circle. If the radius of the fixed circle is R, the radius of the moving circle is r , and the offset of the pen point is a then the resulting curve is defined by: x = (R+r)*cos(t) - (r+a)*cos(((R+r)/r)*t) y = (R+r)*sin(t) - (r+a)*sin(((R+r)/r)*t) where t is a parameter that ranges from 0 t 100 in small increments (say 0.01)
Input
All Input for the above Task needs to taken as Commandline Arguments. No Input will be taken from the Standard Input Stream. The input consists of three numbers namely R, r, a which presents the following quantities R - Radius of the Larger Circle r - Radius of the smaller Circle a - Offset of the pen point in the moving circle
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
