a string and i want to recognize a complex polynomial in that string and if for example if the user inputs the folloing string

(1+i)x^3 +(5i)x^2 +(3+5i)x +5

(each cell in the complex number array consists of a real number and emaginary) the function will put in cell 3 the value 1 in the real part of cell 3 and 1 in the imaginary part of cell 3.

in cell 2 it will put 0 in the real part of cell 2 and 5 in the complex part of cell 2

etc...

is there a way for me to make this function??

another questiob if i got a string ================= a=\b =============== for wich the user puts values for a and b i want to make the following operation on the

t=a.divide(b)

how do i build a mechanism that recognises this pattern??

There are a number of 3rd party libraries for parsing maths expressions. I've never used any, so can't recommend anything, but if you Google 'java math parser' you can take a look at a few and see if any meet your needs.

Joanne

johny doe
Ranch Hand

Joined: Dec 07, 2007
Posts: 78

posted

0

i coundnt find the thing iwas looking for can you be more specific please

Originally posted by johny doe: i coundnt find the thing iwas looking for can you be more specific please

I followed Joanne's instructions, and typed "java math parser" into google. But let me check.... Yup, the first hit claims that it supports complex numbers too.

"The differential equations that describe dynamic interactions of power generators are similar to that of the gravitational interplay among celestial bodies, which is chaotic in nature."