Recently in algebra, I learned about matrices and how to solve equations with them. One of the excerices I had to do was write a computer program that would solve two equations with two variables in the form ax + by = c (where a, b, and c are constants) using matrices. The user would input the 6 constants (a, b, and c for both equations), and the program had to solve the equation and give the x and y values.
My brother had done this last year with his game programing software. Not wanting to be outdone, I put together a program over thanksgiving break that succesfully solves the equations. Using the NXT buttons, a user inputs the 6 constants, whereupon the NXT instantly displays the x and y values (unless the equations were inconsistent or dependent, of course).
It's really neat - especially because I now have an excuse to have my NXT during schooltime! ;)
You can download the main program here, and a zip file with the needed My Blocks here (you'll need to put the My Blocks in the Mindstorms folder for My Blocks).
Here's a picture of inputting the constants (the 6th one is currently being input).
And here's a picture of the solution set (x and y).
-Jonathan
My brother had done this last year with his game programing software. Not wanting to be outdone, I put together a program over thanksgiving break that succesfully solves the equations. Using the NXT buttons, a user inputs the 6 constants, whereupon the NXT instantly displays the x and y values (unless the equations were inconsistent or dependent, of course).
It's really neat - especially because I now have an excuse to have my NXT during schooltime! ;)
You can download the main program here, and a zip file with the needed My Blocks here (you'll need to put the My Blocks in the Mindstorms folder for My Blocks).
Here's a picture of inputting the constants (the 6th one is currently being input).
And here's a picture of the solution set (x and y).
-Jonathan