Live data from Hacker News

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

algebra.js.org

11–20 of 31 posts

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

#11
post #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 t…

Thank you for the kind words! I appreciate it. I agree that I should add a bit more instruction for opening up the JS console in Chrome or FF. I'll also add a use case section to show some practical examples.

Glad to hear you're interested in RNeo4j; let me know what you think.

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

#12

Earlier quoted context omitted.

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.…

That sounds like some fun Friday night reading. :) Glad you enjoy Neo4j!

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

#13
this looks really neat and it must have been a lot of fun to build!

it's not a feature request because I don't have a use case for this quite yet, but how complex would it be to parse a string that contains a formula? for example, it seems useful to be able to load equations by just sending the string "2x - 3 = 4" to a function.

that sounds like a fun problem to solve as well. maybe useful to the library too. just a thought! great work on this library and thanks for publishing.

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

#16
post #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 t…

Thank you for the kind words! I appreciate it. I agree that I should add a bit more instruction for opening up the JS console in Chrome or FF. I'll also add a use case section to show some practical examples. Glad to hear you're interested in RNeo4j; let me know what you think.

For the less dev tools savvy, you could leave those top instructions on solving 2x - 3 = 4 in a console.log in your code. So once they get dev tools open they see some more instructions for the next step.

  console.log("Type the following in this order pressing enter each time you see a semi-colon: \n var expr = new Expression('x'); \n expr = expr.subtract(3); \n expr = expr.add('x'); \n console.log(expr.toString()); \n var eq = new Equation(expr, 4); \n console.log(eq.toString()); var x = eq.solveFor('x'); \n console.log('x = '' + x.toString());");
Very cool project by the way.

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

#17
the API is really clear and aesthetic. the whole work seems self contained. it is just awesome. im excited to think about an addition for matrices and combinatorics and calculus as well. this deserves to become like a Magma for js. unlike quite a lot of Shown HN this already seems complete, even the documentation, so aside from hoping it expands I feel there isnt much missing to point out. maybe a calculator graphical interface to produce expressions? oh and defnitely big num support!

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

#18
post #13

this looks really neat and it must have been a lot of fun to build! it's not a feature request because I don't have a use case for this quite yet, but how complex would it be to parse a string that contains a formula? for example, it seems useful to be able to load equations by just sending the string "2x - 3 = 4" to a function. that sounds like a fun problem to solve as well. maybe useful to the library too. just a…

Thanks! Fun was the main motivation for this project.

Parsing strings into expressions is something that math.js offers currently with math.parse and expression trees[0]; I was discussing it with the author the other day[1].

[0] http://mathjs.org/docs/expressions/expression_trees.html

[1] https://news.ycombinator.com/item?id=10042470

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

#19
post #16

Earlier quoted context omitted.

Thank you for the kind words! I appreciate it. I agree that I should add a bit more instruction for opening up the JS console in Chrome or FF. I'll also add a use case section to show some practical examples. Glad to hear you're interested in RNeo4j; let me know what you think.

For the less dev tools savvy, you could leave those top instructions on solving 2x - 3 = 4 in a console.log in your code. So once they get dev tools open they see some more instructions for the next step. console.log("Type the following in this order pressing enter each time you see a semi-colon: \n var expr = new Expression('x'); \n expr = expr.subtract(3); \n expr = expr.add('x'); \n console.log(expr.toString()); \…

That's a very clever idea. Thanks.

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

#20
post #17

the API is really clear and aesthetic. the whole work seems self contained. it is just awesome. im excited to think about an addition for matrices and combinatorics and calculus as well. this deserves to become like a Magma for js. unlike quite a lot of Shown HN this already seems complete, even the documentation, so aside from hoping it expands I feel there isnt much missing to point out. maybe a calculator graphica…

At one point I did have an interactive example on the project page where you could manipulate an expression with a calculator-looking number pad, but after I ran it by a few friends they seemed mostly confused by its functionality so I removed it.

I definitely want to expand the library's functionality; this project has been my go-to for when I'm burnt out on other projects so I don't plan on putting it down anytime soon. Some basic calculus seems like a natural next step, though that might betray the name algebra.js. :)

Post reply on HN