Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The purpose of this question is to write a complete python program that creates and displays a table of polar and Cartesian coordinates for a

image text in transcribed
The purpose of this question is to write a complete python program that creates and displays a table of polar and Cartesian coordinates for a spiral. An example of a spiral is shown below. 200 Spiral -100 -130 -100 50 50 00 150 200 Write a function that begins with the following header. def computeCoordinatesf(intervals, maxAngle, scale): where intervals is the number of equally spaced angles, maxAngle is the maximum angle for the spiral, and scale is the scale factor for the spiral. The larger maxAngle is, the more revolutions in the spiral. The larger scale is, the farther apart are the lines of the spiral. Create a list of equally spaced angles from 0 to maxAngle radians. Create a list of radii. Use the formula radius scale x angle to compute each radius from the corresponding angle. Add the radius to the list of radii. The lists of angles and radii are the polar coordinates of the points in the spiral. Using the polar coordinates, create lists of the corresponding X and Y coordinates (Cartesian coordinates) of the points on the spiral. Use the formula x = radius x cos(angle) to compute each X coordinate from the corresponding radius and angle. Add each X coordinate to the list of X coordinates. Use the formula y radius x sin(angle) to compute each Y coordinate from the corresponding radius and angle. Add each Y coordinate to the list of Y coordinates. Return the lists of angles, radii, X coordinates and Y coordinates in that order. Write a function that begins with the following header. def displayCoordinates(angles, radii, xCoords, yCoords): This function is given the lists of angles, radii, X coordinates and Y coordinates of the points in the spiral. Display the angle, radius, X coordinate and Y coordinate of each point in the spiral with the coordinates for one point per line of output. See the sample run of the program for the format of the output. Display each angle and radius to 4 decimal places in 10 character positions. Display each X and Y coordinate to 6 decimal

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

Rules In Database Systems Third International Workshop Rids 97 Sk Vde Sweden June 26 28 1997 Proceedings Lncs 1312

Authors: Andreas Geppert ,Mikael Berndtsson

1997th Edition

3540635165, 978-3540635161

Students also viewed these Databases questions

Question

I receive useful feedback about my performance.

Answered: 1 week ago

Question

I am encouraged to offer opinions/suggestions.

Answered: 1 week ago