Stupid imaginary to polar conversion. Need help.

K.I.L.E.R

Retarded moron
Veteran
I do the work on my question sheet right.
I look at the answer and my angles are always wrong.
WHY?

Here is an example:

-1 + sqrt(3)i =

sqrt(-1*-1 + sqrt(3)^2) = sqrt(1 + 3) = sqrt(4) = 2

angle = arctan(b / a) (a != 0 else 45 degrees)

= (arctan(sqrt(3) / -1) * 180) / pi = -60 degrees.

polar rep:
r(cos(theta) + i sin(theta))

= 2 (cos(-60) + i sin(-60))
= 2 * -0.9524129 + 2 * 0.304810i
= -1.9048258 + 0.60962i

euler rep:

2 * e^(-i 60)

So why does the answer sheet say the angle is 120 degrees?
 
I can't remember polar coordinate conversion stuff that well, but just treating it as straightforward trig.
Try drawing it, and looking at it.

Those coordinates give you a triangle whose sides are 1,2,Sqrt(3). (From pythagoras)

The angle you are interested in is the one where with
Opposite = sqrt(3), adjacent =1.
Opposite/adjactent =tan (theta)
Srt(3)/1 =tan (theta)
Theta = 60 degrees.

Now looking at what you used to calculate that the angle we have just calculated is anti-clockwise from the x-axis. So the angle you need is 180-theta.

I am sure that it can be done so that the -signs sort them out and you don't need to do the 180-theta but if visualizing helps then do it.


BTW it is also worth knowing the form of a few trig identities.
I.e. the signs and cosines and tangents of a few particular triangles that often come up (or rather the angles in them often come up. In this case 60 degrees.

Take an equilateral triangle, each side of length 2.
You have three angles of 60 degrees.
Now split the triangle into two. You know have two right angled triangles with angles, 60,30,90 and sides 1,2,Sqrt(3).
The sines, cosines etc are easy to remember this way for common angles.

Where possible leave the sine/cosine as a surd. As they often have a way of canceling out by the end of a problem. It is one way that you can see if you are on the right track when solving a maths problem.

Also make sure that you are using the correct angle measurement throughout.
Sin(-60) is not 0.304810, that is the sine of -60 radians.

Sin -60 is -0.86602 = -Srt(3)/2
Cos -60 =0.5

CC
 
The tan function has a 180º cycle. It's impossible to make arctan map to the whole 360º.

Note that you're "destroying" a sign in arctan(b / a). The result will be the same if you change the sign of both a and b, even though the result you want differs by 180º.
So you have to take the result of arctan(b/a), look at the signs of a and b, and possibly add/subtract 180º to get to the right quadrant.

In most programming languages that has trigonometrics, there's a function atan2(b, a) that does all this. But I've never seen anyone refer to such a function in a maths class.
 
K.I.L.E.R said:
angle = arctan(b / a) (a != 0 else 45 degrees)

= (arctan(sqrt(3) / -1) * 180) / pi = -60 degrees.
You're looking at the wrong quadrant. Sine/cosine/tangeant functions reproduce the same numbers for half of the full 360 degrees, so you need to pay careful attention to what quadrant you're in when doing the inverse.

In this case, since x < 0 and y > 0 (if you write the form as x + iy), you're in the second quadrant, meaning that your angle must be between 90 and 180 degrees (You can see this really easily if you draw it out). So, what you need to do is find an angle, using the symmetry of the tangeant function (since that's the one you made use of) to find an angle between 90 and 180 degrees whose tangeant is the same as the tangeant of -60 degrees.

Edit: By the way, to see why you can get multiple answers here, consider the imaginary number:
1 - sqrt(3)i

...in this case, you'd take the arctan of the above:
arctan (-sqrt(3)/1), but this is the same as what you wrote above! (since -sqrt(3)/1 = sqrt(3)/-1)
 
Back
Top