Astronomy Challenge

constellation

What is a constellation?


In astronomy a constellation is a grouping of stars on the celestial sphere perceived as a figure or design. There are 88 recognized constellations and each of these have been named after characters from classical Greek and Roman mythology as well as various common animals and objects.

Python Challenge


In this challenge we are using Python Turtle to draw famous constellations on the screen.

Each constellation is saved as a list. Each value of the list represents a star. Each star is also a list with only 2 values, the x and y coordinates of the star (drawn on a 2D screen). So a constellation is stored as a list of lists!

For instance, for Cassiopeia:

cassiopeia = [[-90,70],[-50,-10],[0,0],[40,-50],[100,0]]

Using a for loop we can then read the content of the constellation, to plot each star on the screen, one at a time, based on its x and y coordinates.
constellations

x,y Coordinates?


The canvas we are drawing on (using Python Turtle) is 400 pixels wide by 400 pixels high.
Look at the canvas below to understand how (x,y) coordinates work:

Python Code


Check the following code:

Your Task


Complete the following code by adding one more constellation of your choice.

You will find the pattern of the most famous constellations on this website.

sagittarius

unlock-access

Solution...

The solution for this challenge is available to full members!
Find out how to become a member:
➤ Members' Area

Did you like this challenge?

Click on a star to rate it!

Average rating 4.7 / 5. Vote count: 7

No votes so far! Be the first to rate this post.

As you found this challenge interesting...

Follow us on social media!

Tagged with: , ,