On Wed, 8 Jun 2005, Gavin Kistner wrote: > (This isn't a library I plan on maintaining, but ANN felt like the right > prefix for offering up code for mass enjoyment.) > > At work yesterday I needed to do some algebra on some matrix math to > reverse-derive a value. (To be specific, I needed to figure out how to draw > the three euler rotation values out of a ZXY rotation matrix.) After spending > 2 minutes writing out equations and fearing I was making a mistake, I turned > to Excel and some stupid text manipulation to produce my formulae. After 10 > minutes of messing around, I got the answer wrong anyhow. > > I decided to write a little Ruby library to do the task for me. I wrote a > matrix class which knows how to do matrix math on strings, producing formulae > from them. After the initial pass produced a lot of values like "0*sinX" and > "0 + 0 + 1*(sinX)" I made it a bit smarter, so that 0s and 1s properly > simplify the equations during calculation. > > It doesn't produce perfectly-reduced equations by any means, but it did the > trick. In the end, I got my result :) on a related note http://blade.nagaokaut.ac.jp/~sinara/ruby/math http://blade.nagaokaut.ac.jp/~sinara/ruby/math/algebra/ cheers. -a -- =============================================================================== | email :: ara [dot] t [dot] howard [at] noaa [dot] gov | phone :: 303.497.6469 | My religion is very simple. My religion is kindness. | --Tenzin Gyatso ===============================================================================