From 1dbcb1934af298e216376e9ab40072f489594460 Mon Sep 17 00:00:00 2001 From: Lauren Dawnkaski Date: Mon, 30 Sep 2024 12:47:30 -0400 Subject: [PATCH] This is my completed drawing project! I ended up moving the planets around a little more because I didn't like their placement once it was rotating. I am very proud of my work on this project because I was able to combine my new knowledge of computer science with a lot of my math background. I used a lot of trig including right triangle trig law of sines and law of cosines to find certain angles or lengths. I didn't make the model as to scale as I would have liked but I am happy with the results. --- drawing.py | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/drawing.py b/drawing.py index 79b10c1..ef8956a 100644 --- a/drawing.py +++ b/drawing.py @@ -102,27 +102,26 @@ def mars(): left(50.194428) def jupiter(): - left(40.601294) - fly(184.390889146) + left(11.4356462439) + fly(101.198874263) color("peru") fillcolor("peru") begin_fill() circle(15) end_fill() - left(49.398705) def saturn(): - left(41.328658) + left(74.186) fly(212.602916255) color("pale violet red") fillcolor("pale violet red") begin_fill() circle(13) end_fill() - left(48.671341) + def uranus(): - left(41.663539) + left(90) fly(240.831891576) color("light blue") fillcolor("light blue") @@ -140,16 +139,25 @@ def neptune(): circle(11) end_fill() -sun() -orbit() -mercury() -venus() -earth() -mars() -jupiter() -saturn() -uranus() -neptune() +for frame in animate(120, loop=True): + sun() + orbit() + with frame.rotate(0, 360): + mercury() + with frame.rotate(0, 360): + venus() + with frame.rotate(0, 360): + earth() + with frame.rotate(0, 360): + mars() + with frame.rotate(0, 360): + jupiter() + with frame.rotate(0, 360): + saturn() + with frame.rotate(0, 360): + uranus() + with frame.rotate(0, 360): + neptune() done()