Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a function in python that does the following: Create an array of angles from 0 to 2*pi in pi/3 increments. Create two new arrays

Write a function in python that does the following:

Create an array of angles from 0 to 2*pi in pi/3 increments.

Create two new arrays that hold the sines and cosines of this array of angles.

Plot the sine values as a function of the cosine values (i.e. plt.plot(cosines, sines)).

You are expected to observe a polygon.

Modify your polygon function so that the polygon is plotted in such a way that it standing on a point.

This can be done by adding an offset to each element of the array of angles. You should do this by exploiting Numpy syntax that allows you to perform operations over a whole array in a single command. Do not manually add an offset to each of the angles specified in the array.

What is the location of the point on which polygon is standing?

Enter your results as vector of two elements [X,Y] and do not add any extra spaces for example. [5,4]

Modify your developed function in the previous question so that it takes the offset used above as an input argument (in degrees) to the function.Use this offset variable to control how your hexagon is plotted.

Be sure to convert the inputted angle to radians before adding it to the angles array. Also add a series of comment statements (lines starting with a # symbol) at the beginning of your function file that state briefly what the function does, who the author was, and the date when it was written. Make sure you have no completely blank lines between the comment lines.

What is the location of the lowest point in the polygon when input angle is 135 degrees ? Enter your results as vector of two elements [X Y] and do not add any extra spaces. Round your answer up to 4 decimal places , for example. [5.8459,-4.6514]

Note: You need to check the arrays sines and cosines in the functions to find the exact answer.

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_2

Step: 3

blur-text-image_step3

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

Students also viewed these Databases questions

Question

What are the best practices for managing a large software project?

Answered: 1 week ago

Question

How does clustering in unsupervised learning help in data analysis?

Answered: 1 week ago

Question

3. Job rotation is used for all levels and types of employees.

Answered: 1 week ago