News for hackers. Stuff that matters.
Re:Graphtoy by Buttons840 on Sunday January 03, 2021 @10:23PM (#25627642)
Anyone know of graphing software on the computer that can graph arbitrary inequalities and logical expressions like the HP Prime's advanced graphing can? [0] For example, if you say x^2 = y it will draw a sideways parabola, top and bottom (yes, it's not a function). Or if you say 10 = x^2 + y^2 it will draw a circle without any gaps. Or if you say

    sin((1+sin(x+y))*asin(.5*(sin(x)+sin(y)))+(1+sin(x-y))*asin(.5*(cos(x)+cos(y))))=0
it draws something like a chain link fence. [1] It works well on a battery operated calculator, so a desktop computer should have no trouble with it, but does the software exist?

[0]: https://www.youtube.com/watch?v=GAVqjBxFyXA [1]: https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2F...

Re:Graphtoy by dllu on Monday January 04, 2021 @01:29AM (#25628395)
I made an implicit plotter here: https://daniel.lawrence.lu/blog/y2016m02d08/

Your function works fine here and my blog post contains many examples of other cool functions to plot, including the pathological

    exp(sin(x) + cos(y)) - sin(exp(x+y)) = 0
My plotter is very slow, however; it uses random sampling instead of any sort of clever interval arithmetic.
Re:Graphtoy by maxwelljoslyn on Sunday January 03, 2021 @10:31PM (#25627677)
On HN a few days ago, I saw a Windows program which seemed like it would do as you describe (and much more.)

But - curses - I didn't bookmark it, at least not in the normal place. I'll look a little harder for you. If I don't update/follow up on this comment, assume I didn't find it. :(

EDIT: Aha. It's called "EvalDraw." Cheers to user 'TeMPOral for sharing.

https://news.ycombinator.com/item?id=25575775

Re:Graphtoy by TeMPOraL on Monday January 04, 2021 @08:14AM (#25630875)
Yup, I usually used EvalDraw in (x,y) mode to graph inequalities. You have to remember though that equations like x=y or x-y = 0 represent a line - an infinitely thin object - so EvalDraw will likely not draw you anything given such input. You have to translate your equation into something that has thickness. E.g. an f(x) = 0 into abs(f(x)) < 0.01

For instance, GP's example: (x,y) abs(sin((1+sin(x+y))asin(.5(sin(x)+sin(y)))+(1+sin(x-y))asin(.5(cos(x)+cos(y)))))<0.01

Draws a beautiful red chain-link fence on blue background.

If you can rewrite your formula to give you a value between 0 and 1, you'll get a nice color gradient. And then you can have more direct control over colors using some of the things I described in the linked comment.

Re:Graphtoy by interpol_p on Sunday January 03, 2021 @10:56PM (#25627799)
If you have a mac the built in Grapher.app (in Applications/Utilities) can graph those things. I pasted your chain-link-fence example and it graphs fine
Re:Graphtoy by lifthrasiir on Sunday January 03, 2021 @11:05PM (#25627825)
GrafEq [1] from Pedagoguery Software is one of best-known softwares that can handle a variety of implicit 2D plots (it's a shareware, though). The algorithm for its earlier version is based on generalized interval arithmetics and described in the author's thesis [2]. I like it so much that reimplementing it is one of my (ever-growing) longer-term projects...

[1] http://www.peda.com/grafeq/

[2] http://www.dgp.toronto.edu/~mooncake/thesis.pdf

Re:Graphtoy by mojomark on Sunday January 03, 2021 @10:31PM (#25627679)
Have you tried the Wolfram Alpha app? I didn't try all of the examples you posted, but graphing a circle works fine.

I use this app all the time to help me simplify expressions (I'm an engineer - I use math, I love math, but I am no mathematician, so I seek shortcuts where I can to save time).

1.) Compute '10 = x^2 + y^2' with the Wolfram|Alpha website (https://www.wolframalpha.com/input/?i=10+%3D+x%5E2+%2B+y%5E2) or mobile app (wolframalpha:///?i=10+%3D+x%5E2+%2B+y%5E2).

Re:Graphtoy by Buttons840 on Sunday January 03, 2021 @10:37PM (#25627704)
I was hoping to be able to utilize the incredible calculator I possess, but it's a good suggestion even if it's not what I'm hoping for.
Re:Graphtoy by bbkane on Sunday January 03, 2021 @10:38PM (#25627716)
Re:Graphtoy by mkl on Monday January 04, 2021 @03:36AM (#25628924)
Desmos and GeoGebra can both do this (though GeoGebra has little gaps in this particular example, and you'll need arcsin rather than asin for both tools). If you want programming-oriented, Sympy can do an okay job (asin), as can Numpy (arcsin), but the latter involves more mucking about, evaluating on a grid.
Re:Graphtoy by Foobar8568 on Monday January 04, 2021 @03:20AM (#25628845)
HP Prime and some other calculators (at least one TI) is based on GIAC XCas so here you go https://www-fourier.ujf-grenoble.fr/~parisse/giac.html
Re:Graphtoy by ttoinou on Monday January 04, 2021 @08:14AM (#25630874)
MathStudio on iOS is really good for that purpose http://mathstud.io/apps/

I thought it was called SpaceTime before, not sure