Question: Resolve using the Haskell coding language 6. drawOrbit Task: Draw a planet in a circular orbit given an orbital radius and period. For this and

Resolve using the Haskell coding language

Resolve using the Haskell coding language 6. drawOrbit Task: Draw a planet

6. drawOrbit Task: Draw a planet in a circular orbit given an orbital radius and period. For this and the next function we'll be using a graphics library called Gloss, which makes it easy (and fun!) to create drawings and animations in Haskell. A planet in a uniform, circular orbit with radius r and period p can have its position described (relative to the origin) at time t with the polar coordinate (r,p2t). Recall that converting between polar and Cartesian coordinates can be done with the equations: x=rcos To produce a picture of a "planet" in Gloss, we will draw a simple, solid circle. We can do this with the function call circlesolid 10. To draw the circle at Cartesian coordinate (x,y), we would do translate x y (circlesolid 10). Note that both circlesolid and (documentation linked) return type picture, which is what must also return. We call for you from "Main.hs", and when you're done with your implementation and want to test it out, do a fresh then run the executable by entering the command (in your repository, outside of GHCi). If all is correct, this should bring up an animation of the circular orbit in a separate Gloss viewer window. Close the window by hitting the Escape key. If you look in "Main.hs", you'll find the relevant line: color azure $ draworbit 1508t Which is calling your function with fixed values of r and p, and a (perpetually increasing) time t, then coloring the returned "planet" azure and drawing it in a window of size 500 by 500 centered at the origin

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!