Search code examples
javaandroidnumberscomplex-numbers

isolate real number in complex number in java


There is a formula i need to use for my app : here

the part Sqrt(5-25) , can be positive or negative , and of course when negative we got a imaginary part that java cant handle.

i've searched around to find a complex class to handle that , but found only basic operation (+-*/).

how can i solve this in java knowing i only need to get the real part ?(imaginary have no importance)

i precise that i develop on android platform

(i post on stack because it's concerning application in java , but if its belong to math.se , tell me)


Solution

  • You can simply compute verything before:

    plot 25-20+((2Pi0.3²)/(Pi10²)Sqrt[2*980(1+(Pi10²)/(Pi10²))]t)² from 0 to 38

    or

    plot 25-20+((2*0.3²)/(10²)Sqrt[2*980(1+1)]t)² from 0 to 38

    or

    25 - 20 + 4 * 0.0000081 * 3920*t^2 from 0 to 38 (I have some factor wrong, but you get the idea)

    just apply basic math to the constants and remove the middle (imaginary part) after applying the 2nd binomic formula.

    There is nothing to do with complex numbers.