Post Reply 
NewRPL: Complex Numbers in Cartesian Form r[x,y] , ...
03-16-2017, 10:11 PM (This post was last modified: 03-16-2017 10:14 PM by Claudio L..)
Post: #2
RE: NewRPL: Complex Numbers in Cartesian Form
(03-16-2017 03:47 AM)compsystems Wrote:  Hello, sorry for my bad English

The Book "Complex Variables and Applications - James Ward Brown, Ruel ..."
Shows in your introductory part operations of complex numbers in cartesian form, I am replicating this in a library (HP-50), I would like to see this notation in NEWRPL, in addition to the phasor form (Widely used in Electrical and Electronic engineering)

Complex numbers are already implemented, but if you mean having the complex numbers written like (a,b) within a symbolic, there's a whole lot of syntax issues that arise from the use of parenthesis to separate the ordered pairs.
I started working on the modifications to the parser to allow this, but I never finished and got stuck with parsing problems, so it's still in the todo list.
I'm not sure it's a good idea since it gets confused with a function call (there's a reason the 50g doesn't allow it), but perhaps we could have a function C(re,im) that constructs a complex number. Then the syntax would be consistent and algebraic rules can be added to operate with the arguments of these functions:
C(a,b)+C(c,d)->C(a+c,b+d)
and so on for all other operators.
If this is OK, then the parser doesn't need to be touched, only the function C needs to be added.
However, when working with algebraic expressions it's always best to use 'x+i*y' format. I'll have to think about this more in depth to see how the pieces would fit together.

EDIT: I guess a flag could determine if you want a complex number in an expression to be decompiled as 'x+i*y' or 'C(x,y)'.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: NewRPL: Complex Numbers in Cartesian Form - Claudio L. - 03-16-2017 10:11 PM



User(s) browsing this thread: 1 Guest(s)