Handmade Hero » Forums » Code » Day 365 - math solving software
Mārtiņš Možeiko
1831 posts / 1 project
#10948 Day 365 - math solving software
1 year, 9 months ago Edited by Mārtiņš Možeiko on Feb. 20, 2017, 7:54 p.m.

I watching this episode now and want to address Casey's complaints about math solving software. I can recommend using SageMath open-source software for that. No need to pay hundreds of dollars for expensive math packages if all you want is to solve simple equations. You can download it for using offline, but note that it is pretty big, because it is built on top of other open-source software. Another option is to use its online version which might be slow, because they offer it for free.

In my previous job our researchers did a lot of work with SageMath mostly focused on number theory for crypto stuff.

As for our ray intersection solution, you can enter following program and press "Run" button to execute it:

eq1 = pax + ta*rax == pbx + tb*rbx
eq2 = pay + ta*ray == pby + tb*rby


Pretty simple. And this is how the result will look like: https://cloud.sagemath.com/projec...b7/files/2017-02-19-214708.sagews
[[ta == -((pay - pby)*rbx - pax*rby + pbx*rby)/(ray*rbx - rax*rby),
  tb == -((pay - pby)*rax - pax*ray + pbx*ray)/(ray*rbx - rax*rby)]]

I believe SageMath uses Maxima software for solving this, so you might be able to install only Maxima, instead of whole SageMath if you care about installing something smaller.
39 posts
#10949 Day 365 - math solving software
1 year, 9 months ago Edited by people on Feb. 20, 2017, 8:28 a.m. Reason: program name fixup

Can confirm that maxima works for this, even though it's lispy it was the lightest weight program I could find that actually worked for symbolic equation transformation. I used xmaxima so that I could use the arrow keys to move around and retrieve past commands with the up arrow, for some reason the commandline version doesn't support this.
Casey Muratori
817 posts / 1 project

Casey Muratori is a programmer at Molly Rocket on the game 1935 and is the host of the educational programming series Handmade Hero.

#10989 Day 365 - math solving software
1 year, 9 months ago

This is really interesting Martins... I will check it out! Maybe we can use it on stream...

- Casey