Did I derive a function for finding the angle of a complex number?

49 Views Asked by At

When presented with a complex # written in rectangular form (x + j*y), w/ the goal of converting it to polar form, the following 2 relationships are used:

  • r = √ ( x^2 + y^2 )
  • θ = tan-1(y/x)

The equation for r works just fine but the one for θ breaks down w/ negative inputs... so either you do as I do and use whichever trig relationship makes the most sense for the given quad, or you can continue using tan but you must abide by quad dependent contingencies:

  • θ = tan-1(y/x) + 180, x < 0, y < 0
  • θ = tan-1(y/x) + 180, x < 0, y > 0
  • θ = tan-1(y/x) + 360, x > 0, y < 0
  • θ = tan-1(y/x), x > 0, y > 0

I decided to throw all of these contingencies into a single package and I would like your feedback on it:

θ = tan-1(y/x) + (1/2)((x/|x|) - 1)(180) + (1/2)((x/|x|) + 1)(-1/2)((y/|y|) - 1)(360)

Which translates to... if x < 0 ADD 180, else if x>0 AND y<0 ADD 360.

And, after simplifying, it looks like this:

θ = tan-1(y/x) - 90[(y/|y|)((x/|x|) + 1) - 2]

As far as feedback goes, I have a couple of questions:

  • Is there an equation already like this?
  • If so, is it simpler than mine?
  • If no, you might come up with a simpler approach! Please share it w/ me if so (:! I think it would be cooler if it didn't require absolute value operations but I couldn't figure out any other way to get 1 for pos #s and -1 for neg #s.
  • Did I make any mistakes? I entered complex numbers for each quad and received the correct outputs. Let me know if you spot any errors.