# Rectangular to polar conversion question.

#### Michael S

Joined Mar 25, 2013
10
Hello,
On this page: Volume II - AC » Reactance And Impedance -- R, L, And C »

The rectangular notation for the amperage of the inductor is shown as -28.490m + j32.516m

When I use tan-1(32.516/-28.49) I get -48.78 (180 degrees out) now if I flip the angle to 131.22 shouldn't the voltage also flip from 43.232 to -43.232?

my method of conversion works fine for converting the resistor's amperage (and all problems up until now) from rectangular to polar. what is unique about this problem?-

#### WBahn

Joined Mar 31, 2012
25,556
I can't tell where you are referring to. Could you post a link to the exact page you are talking about?

#### MrChips

Joined Oct 2, 2009
20,880
The amplitude of a sine has no sign. It is always positive.
It's the phase angle that can be positive or negative.

#### Michael S

Joined Mar 25, 2013
10

#### Michael S

Joined Mar 25, 2013
10
about 3/4 of the way down,:

Since the L and C2 are connected in series, and since we know the current through their series combination impedance, we can distribute that current figure to the L and C2 columns following the rule of series circuits whereby series components share the same current: #### MrChips

Joined Oct 2, 2009
20,880

The amplitudes are all positive. The phase angles can be positive or negative.

#### Michael S

Joined Mar 25, 2013
10
it's not so much a point as a question.
if tan-1(32.516/-28.49)=-48.78
slightly higher on the same page : converting rectangular to polar for total Z using the same formula (tan-1(imaginary/real))yields:
tan-1(-696.79/429.15)=-58.371

why does the formula give me the correct answer for total impedance conversion but the incorrect answer for inductor current conversion?

is the answer i got of -48.78 the same as 131.22 and if so, why is the correct angle -58.37 (total Z) not expressed as 121.63

#### MrChips

Joined Oct 2, 2009
20,880
Draw the X-Y axes.

Pay attention to which quadrant the resultant vector falls.

angle increases from 0° to 360° as we go in counter-clockwise direction.

3rd quadrant, -X -Y, 180-270° which can be written as (angle - 360)
4th quadrant, +X -Y, 270-360° which can be written as (angle - 360)

#### WBahn

Joined Mar 31, 2012
25,556
it's not so much a point as a question.
if tan-1(32.516/-28.49)=-48.78
slightly higher on the same page : converting rectangular to polar for total Z using the same formula (tan-1(imaginary/real))yields:
tan-1(-696.79/429.15)=-58.371

why does the formula give me the correct answer for total impedance conversion but the incorrect answer for inductor current conversion?

is the answer i got of -48.78 the same as 131.22 and if so, why is the correct angle -58.37 (total Z) not expressed as 121.63
The short answer is that tan-1(32.516/-28.49) is not the same as tan-1(-32.516/28.49). That arctangent function you are using is the two-quadrant arctangent and maps things to angles between -180° and +180°. You need to be using the four-quadrant arctangent (often called atan2 because that is the name given to the function in many programming languages) or you need to manually adjust the results of the two-quandrant arctangent function.

#### Michael S

Joined Mar 25, 2013
10
Perhaps I should have stated,I am not a student, but rather an old guy with a high school diploma trying to learn a new skill. atan2 is still in my future chapters. If I come across an answer such as this one (tan-1(32.516/-28.49)=-47.78) how do I recognize that it has to be flipped to equal 131.22? The conversion for total impedance (tan-1(-696.79/429.15)=-58.371) did not have to be flipped. Is it because the current lags the voltage and MUST be a positive number?

#### MrChips

Joined Oct 2, 2009
20,880
Did you follow my post #8 and WBahn's #9?

tan(angle) = y/x

Don't use the sign of y and x.

If +y and -x, the result is in the 2nd quadrant, i.e. the angle is (180 - angle).

If -y and +x, the result is in the 4th quadrant, i.e. you can use -angle.

#### studiot

Joined Nov 9, 2007
4,998
Some trigonometry that may be of interest.

#### studiot

Joined Nov 9, 2007
4,998
Trigonometry part 2

#### Michael S

Joined Mar 25, 2013
10
Did you follow my post #8 and WBahn's #9?

I read it but without understanding until now-
I now understand. Thank you all for the help. I will add this to my notebook so i don't make the same error(s) again.

#### WBahn

Joined Mar 31, 2012
25,556
It has NOTHING to do with voltages or currents or leading or lagging or electronics at all. It is straight up pure trigonometry.

Consider the following diagram that shows vectors in each of the four quadrants. The normal arctan function takes a single real number that is the ratio y/x and returns an angle between -90° and +90°. But, in general, our vectors can lie in any of the four quandrants and we want to get an angle between -180° and +180°. So how do we get that if all we have is the arctan function?

We need to have the values for y and x separately. By noting which is positive and negative, we can easily determine which quadrant the angle lies within.

Y​
|
X​
|
>0​
|
>0​
|
I
>0​
|
<0​
|
II
<0​
|
<0​
|
III
<0​
|
>0​
|
IV​

If y/x is positive, it could either be because both y and x or positive (Quadrant I), or because both y and x are negative (Quandrant III). But the arctan function has no way of knowing, so if the argument given to it is positive it will assume that the angle lies in Quadrant I and return the angle A. But if the angle actually lies in Quadrant III, then you want angle C. Given angle A, you can see that you can get angle C by subtracting 180°.

If y/x is negative, it could either be because y is negative and x is positive (Quadrant IV), or because y is positive and x is negative (Quandrant II). But the arctan function has no way of knowing, so if the argument given to it is negative it will assume that the angle lies in Quadrant IV and return the angle D. But if the angle actually lies in Quadrant II, then you want angle B. Given angle D, you can see that you can get angle B by adding 180°.

The final algorithm is extremely simple:

Rich (BB code):
IF x > 0  // Quadrants I and IV
angle = atan(y/x)
ELSE
IF y > 0  // Quadrant II
angle = atan(y/x) + 180°
angle = atan(y/x) - 180°
or, equivalently:

Rich (BB code):
angle = atan(y/x)

IF x<0
IF y > 0  // Quadrant II
angle += 180°
angle -= 180°

#### WBahn

Joined Mar 31, 2012
25,556
Okay, so my post is pretty much a waste. I didn't see any of the page 2 posts before I posted mine. Oh well.

#### Michael S

Joined Mar 25, 2013
10
Wow. I've just got done completely absorbing the information you all have given me. I want to thank you all for your patience and time you've spent on me. Nothing was wasted. Thank You

#### MrChips

Joined Oct 2, 2009
20,880
You're very welcome. Come again anytime.