Wednesday, November 09, 2005

Ruby 3D Point

I need to do some 3D structure analysis for a contract. While I already have a substantial amount of Java code that I could use, I've decided to build up some capabilities for the work in Ruby.

The first object I put together for this is Point3, a cartesian 3D point, and a basis for most of the work to follow. (Test cases are in tc_point.rb) Instances of the class can be created from coordinates or other Point3s, and can be aded, subtracted, multiplied, divided, negated, tested for equality and printed.

More to come...

No comments: