octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: polar(i)


From: Doug Stewart
Subject: Re: polar(i)
Date: Wed, 2 Dec 2015 16:03:52 -0500



On Wed, Dec 2, 2015 at 3:03 PM, Muhali <address@hidden> wrote:
Doug Stewart-4 wrote
> so to use polar notation of complex numbers use
>
> a=angle+mag*j

well, that IS confusing, at least for the mathematically trained eye. In the
complex plane your number a, as a complex number, would not be at (0,1) but
at (pi/2,1). It would have the "canonical" representation in polar form

arg(a) = 0.567 = "angle" ≠ pi/2
abs(a) = 1.86 = "magnitude" ≠ 1

So, whatever "angle" means in the form presently used by octave, it is not
the angle in the complex plane. What angle is it then? Or what plane?


This is not math!!! This is just a way to hold an angle and a length in a single variable.

It does not conform to any math. But you could make a function to convert it to 
a complex number.
You would have to do the following to make a Cartesian number

function ret = conv2math(a)
realpart= imag(a)*cos(real(a))
imagpart=imag(a)*sin(real(a))
ret=realpart+imagpart*i
endfunction


But it is not intended for math just to hold numbers to be plotted with polar.
I didn't invent it I just read octaves help section

Using this you can store the angle and length in a scalar.
If you use 
 q=cart2pol(1 ,+.5)
q =

   0.46365   1.11803
size(2)
1 2
 
1 row and 2 col.



--
DAS


reply via email to

[Prev in Thread] Current Thread [Next in Thread]