Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby mathematic gem

does anybody know if there is a good gem for mathematic / geometric operations? I need some of this things:

  • Dot product
  • Cross product
  • Angle between vectors
  • Matrix
  • Surface normale
  • Vector calculations (add, substract...)
  • Singular Value Decomposition

thx, tux

like image 782
23tux Avatar asked Mar 24 '11 08:03

23tux


2 Answers

I can highly recommend the Ruby/GSL gem.

You may need to refer to the GSL manual to work out the name of the function you need to call though, if it's not documented in the Ruby/GSL documentation.

like image 74
npad Avatar answered Nov 04 '22 18:11

npad


http://linalg.rubyforge.org/ seems to do what you want. It is based on LAPACK, the standard ultra tested 40-year linear algebra framework. Moreover, you can plug in vendor-specific LAPACK libraries for optimized code.

like image 2
Alexandre C. Avatar answered Nov 04 '22 20:11

Alexandre C.