does anybody know if there is a good gem for mathematic / geometric operations? I need some of this things:
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.