Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Must be done on Python 3 without using the modules numpy or turtle. Please do the bonus assignment as well. Spirograph was a popular toy

image text in transcribed

image text in transcribed

Must be done on Python 3 without using the modules numpy or turtle.

Please do the bonus assignment as well.

Spirograph was a popular toy when I was a child. It consists of two interlocking gears of different sizes: the larger wheel is pinned to the drawing board while the smaller one rotates around the outside (or inside) of the larger. A pen, placed in a hole some distance from the center of the small wheel, traces out geometric patterns called epitrochoids (outside) and hypotrochoids (inside). Planetary motion in the long lived (over 1500 years) Ptolemaic model was described by epitrochoids. The goal of this project is to program a Python script to draw epitrochoids and hypotrochoidis using the matplotlib.pyplot module. The figures are defined by three parameters: the radii of the circles, R andr, and the distance of the pen from the center of the small circle, d. Illustrations can be found here and here. The curves can be traced out by incrementing the polar angle in the following expressions: x(0)=(R+r)cos 6-d costro Epitrochoids y (0)=(R+r)sin -dsin Rure x (6)=(R-r cos e+d cos pro Hypotrochoids y(0)=(R-r) sin 8-dsin RC Write a python function to draw either an epitrochoid or an hypotrochoid for given values of the parameters R,r, and d.The selection of the figure (epitrochoid or hypotrochoid) should be an additional input argument to the function along with the number of circles. The script must not contain any numpy functions or other modules such as drawing modules, such as turtle. Plot 4 different figures (two epitrochoids and two hypotrochoids). Submit a python file that will plot all 4 figures you wish to have graded in a single frame using the module matplotlib.pyplot. subplot() N If you want to make really nice plots you need to have an exact number of cycles (multiples of 2) so that both circles complete at the same value of e. The formula for N (number of cycles) is lcm(R.ry/R, where the lowest common multiplier can be found from the formula using the greatest common divider: 1cm (m, n) = m*n/ged (m, n) god is part of the math library (but lcm is not). Bonus assignment: The Spirograph toy included a ruler shape (as well as circles). The edge of the ruler could be defined by straight lines y=d spanning the range 0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Information Modeling And Relational Databases

Authors: Terry Halpin, Tony Morgan

2nd Edition

0123735688, 978-0123735683

More Books

Students also viewed these Databases questions

Question

b. Why were these values considered important?

Answered: 1 week ago