Tuesday, January 6, 2009

More data types

The current data types include various precision and range of integers, real numbers, point, line and polygon types with restrictive operations between them.

I would like the ability to specify orientations and vectors as data types. The Vector data type should take 3 fields for X, Y, Z and the orientation data type should be the amount of rotation about an axis or as a 3x3 rotation matrix, or as a combination of roll, pitch and yaw. A more general data type should be the transform, which is a 4x4 matrix including both the 3x3 rotation matrix and the vector.

The mathematics of transformations, and operations on vectors and transforms and fixed and moving coordinate systems, is well understood in the literature of robotics which deals with motion in space, and well defined in many languages for controlling robot motions.

The purpose of these additional types is to provide a level of abstraction to simplify the conceptual computation. Instead of specifying the x,y,z components of translation in 3-d space, we could easily ask that a point, line or area be moved by a vector specified by the 3 components. This is particularly useful when all three components are specified and used in multiple places.

No comments: