0

I have an issue that I can't seem to solve. I have already acquired data from another source and created 2 polynomials that are identical in shape but not in orientation, that is one is rotated x degrees compared to the other, and if you rotate the graph x degrees back they will match. I have already taken the derivative of both of the graphs at a certain point. I would like to graph these slopes onto a unit circle on a polar graph, and somehow find the angle difference between these two line segments of slope i and j that extend from the origin. I'm fairly new to python so I so not know how to begin plotting these in polar or finding a way to determine the angle difference. I know that by hand, you can take the inverse tangent but that will only give you a range from +90 to -90. I would like my number to fall in the range from 0 to 360 for rotation.

Any help is appreciated. If this isn't enough info or if it isn't clear enough I can provide more.

Shawn Mehan
  • 4,513
  • 9
  • 31
  • 51
Changxiao Xie
  • 41
  • 1
  • 1
  • 2
  • 2
    Part of your answer will surely be the dot product of your two lines. [Here](http://stackoverflow.com/questions/13226038/calculating-angle-between-two-lines-in-python) are some fine words on this very subject. – Shawn Mehan Sep 09 '15 at 03:36
  • 1
    Did you take a look through the [matplotlib gallery](http://matplotlib.org/gallery.html#pie_and_polar_charts)?? – wwii Sep 09 '15 at 04:07
  • I think 360 degree is 2*np.pi, so your x axis ranges from 0 to 2*np.pi. You could use a polar chart. Provide your functions and what you have done so far. – Moritz Sep 09 '15 at 06:08
  • The slopes of both functions are -0.41955220665252518 and 0.24426141395298115. I can plot them onto matplotlib but I need to plot them on a polar graph as radii and find the angle between them. That's the part I'm not sure about how to accomplish – Changxiao Xie Sep 10 '15 at 13:38

0 Answers0