aditeyabaral / gpython

Recreated the popular graphing application "Desmos" on Python using matplotlib, scipy and numpy. GPython can be used as an extensive graphing application that can plot 2D, 3D and even polar curves and also differentiate and integrate functions.
13 stars 8 forks source link

Verification of Plots and Equations #1

Open aditeyabaral opened 4 years ago

aditeyabaral commented 4 years ago

Some equations do not support plotting. These equations are of the form y n = f(x). It would be great if these plots can be added somehow!

ajayjha5899 commented 4 years ago
$ python3 Plotter.py 
Enter function : (3*x+5)**0.1

This is working fine. [P.S- Please correct me if I've misunderstood yn = f(x).]

aditeyabaral commented 4 years ago

Hello, If you take the example of a circle at Origin given by x 2 + y2 = r2, then the application requires an input as a function of y, hence it would turn out to be y = sqrt(r2 - x2). Plotting this would only return an incomplete circle. This issue would arise for all even powers due to the nature of the function (as well as 3D plots). It would be great to find a workaround, or maybe even a different algorithm that handles all cases!

aditeyabaral commented 4 years ago

Just an addition to this - This can be obtained using the numexpr library. It can be used to evaluate expressions and can be used to remove the eval function used in the current implementation. Check here for more details.

As far as I can see, the only generic approach is to evaluate the LHS and RHS separately or in parallel (if possible) and then equate and pick the values that do satisfy. However any other workaround is appreciated.

Chakita commented 4 years ago

I'd like to take up this issue, and replace eval with numexpr

aditeyabaral commented 4 years ago

Alright sure

ritwikchakraborty123 commented 4 years ago

@aditeyabaral I want to contribute

aditeyabaral commented 4 years ago

@aditeyabaral I want to contribute

@ritwikchakraborty123 this issue is currently being handled by @Chakita, please contribute to another issue