Live data from Hacker News

Show HN: Algebra.js – Build, display, and solve algebraic equations

algebra.js.org

1–10 of 31 posts

Re: Show HN: Algebra.js – Build, display, and solve algebraic equations

#3
post #2

So it's like an early-stage CAS written in Javascript? E.g. Sage math ( http://www.sagemath.org/ )

Yeah, it could be used like that. The main use case that kept coming to mind while I was writing it is interactive tutorials. You could easily build an interactive "what happens when you multiply this expression by [some user input]" type of thing.

Re: Show HN: Algebra.js – Build, display, and solve algebraic equations

#4
Nice work Nicole! :-)

I work on a similar library for C# (Symbolism [1]).

Consider allowing for variable elimination in sets of equations. (See this problem for an example: https://gist.github.com/dharmatech/a14d1a29a7d4c0728d37)

[1] https://github.com/dharmatech/Symbolism/

Re: Show HN: Algebra.js – Build, display, and solve algebraic equations

#5
Hello HN,

I was learning JavaScript by completing challenges on CoderByte[0], where one of the hard challenges was to find the point where two lines intersect. The lines were defined by two sets of points, and you had to return your answers as rationals, not floats. The challenge isn't timed, so I got a little carried away: ended up making a Fraction class, Equation class, etc. This first iteration could only solve linear equations, but I decided to expand it out into a library that could solve higher order polynomials and manipulate expressions.

On a related note, solving cubics is actually kind of hard. This guy Cardano[1] figured it out[2] in the 1500s, but his solution was incomplete because he wasn't aware of imaginary numbers at the time. I then found you could solve cubics with some trig[3] and decided to go that route. Anyway, hope you enjoy, and of course I am interested in your feedback.

[0] http://coderbyte.com/

[1] https://en.wikipedia.org/wiki/Gerolamo_Cardano

[2] https://en.wikipedia.org/wiki/Cubic_function#Cardano.27s_met...

[3] http://www.nickalls.org/dick/papers/maths/cubic1993.pdf

Re: Show HN: Algebra.js – Build, display, and solve algebraic equations

#6

Nice work Nicole! :-) I work on a similar library for C# (Symbolism [1]). Consider allowing for variable elimination in sets of equations. (See this problem for an example: https://gist.github.com/dharmatech/a14d1a29a7d4c0728d37 ) [1] https://github.com/dharmatech/Symbolism/

That's very cool. I should definitely add functionality for solving a system of equations.

Re: Show HN: Algebra.js – Build, display, and solve algebraic equations

#7

Nice work Nicole! :-) I work on a similar library for C# (Symbolism [1]). Consider allowing for variable elimination in sets of equations. (See this problem for an example: https://gist.github.com/dharmatech/a14d1a29a7d4c0728d37 ) [1] https://github.com/dharmatech/Symbolism/

That's very cool. I should definitely add functionality for solving a system of equations.

The algorithm I use in 'EliminateVariables' is pretty ad-hoc and has built up as I throw more situations at it.

If you want to look up how the big time guys do it, I believe Mathematica's 'Reduce' performs full on quantifier elimination via cylindrical algebraic decomposition. There aren't many open-source implementations of CAD that I know of besides the venerable C-based QEPCAD.

PS: Big fan of your Neo4J tutorials. :-)

Re: Show HN: Algebra.js – Build, display, and solve algebraic equations

#8
This seems like a good start towards a symbolic math library like SymPy[0] for JavaScript. There's lots of cool client-side applications for such a library, something like Mathway[1] or WolframAlpha[2] that doesn't need to hit a server to do the symbolic computation.

[0] http://www.sympy.org/

[1] https://mathway.com/

[2] http://www.wolframalpha.com/

Re: Show HN: Algebra.js – Build, display, and solve algebraic equations

#10
This is so well done! There are so many little touches here that delights me like the keyboard shortcuts for jumping right in and the LaTeX support. Even though this started off as a learning project for you, know that this is probably better than 95% of the API documentation I read from more professional development teams.

Jason Long's Cayman Theme was unfamiliar to me until I saw your citation. Kudos to your good taste.

Documentation is pretty good. It probably skews more towards developers with experience using other libraries, but I think that's fine for a first version. If you want to kick it up some more, I'd love to see more practical examples that might inspire me to use it out in the wild. Also, it took me awhile to figure out what to do with the keyboard shortcut. Something more explicit or even a small screencast would be nice.

I see that you also work on the RNeo4j library, which looks super cool. Queueing that up in the future to play with...since R is a much better place for me to feed that graphing library data. Thank you so much for sharing this!

Post reply on HN