I am a beginner with Numpy/Matplotlib (and scientific python) and I find that very easy things are relatively complicated to do because they have to be done by hand. (like without having this awesome math environment)
I thought that at least there would be a possibility for example to easy get the angle of two intersecting lines.
I want to do the following. I have those three points:
(q) |
\ |
\ |
\a|
\|
(p)
|
|
|
(o)
- All what I want to do is to calculate the angle a.
- Also later I want to get a point z which is relative to the origin (0,0) with the distance from p to q and the angle a.
The first thing is easy with math, first I calculate two vectors a1 and a2.
Then I calculate:
a = arccos( ( a1 * a2 ) / (|a1| * |a2|) )
and so on…
But how the hell do I do this in matplotlib?
Is there a way to “just” give the three points and it does everything?
I don’t really see a advantage of doing this whole stuff on my own with having an math environment.
Numpy provides the same functionality math provides but working on both numbers and arrays. So you would do :