# Boost :

From: Hickerson, David A (david.a.hickerson_at_[hidden])
Date: 2006-06-15 16:38:48

Matrices are not less precise mathmatical than other other methods. They
do require more multiplies and adds than quaternion for rotations. As
for unituitive, that would only be for those without any training in 3D
computer graphics or robotics or a similar field.

A 4x4 matrix represents rotation, scaling, shrear, perspective, and
translation. A 4x4 matrix can easly be read to directly tell you its x,
y, z axes and the amount translation from the current reference frame in
a purely positional transformation.

When doing work in graphics or robotics, the 4x4 matrix is powerful tool
and there are good algorithms for rotation matrix to quaternion
representations and back.

What you should avoid is Euler angles, granted they are intuitive.
However, if you have ever worked in multiply fields of engineering, you
will find that there are multiply orders of applying the rotations.
Additionally, Euler angles are subject to gimbal lock, where matrices
and quaterions are not.

Geoffrey wrote:
> And it is not true that "when doing transformations on vectors, you
must use 1 dimension
> higher than the level you are working in."

He would right had I said rotations. Transformations are rotations and
translations requiring the extra dimension.

[ x1, x2, x3, 0]
[ y1, y2, y3, 0]
[ z1, z2, z3, 0]
[ t1, t2, t3, 1]

This matrix represents a rotation by the x, y, and z vectors, and a
tranlation by the t vector in 3 space. In 2 space it would be:

[ x1, x2, 0]
[ y1, y2, 0]
[ t1, t2, 1]

Those representations are in graphics format, where mathmatics or
engineering would be the tranpose.

Dave

-----Original Message-----
From: Geoffrey Irving [mailto:irving_at_[hidden]]
Sent: Wednesday, June 14, 2006 3:20 PM
To: boost_at_[hidden]
Subject: Re: [boost] [pqs] Vector<3>

On Wed, Jun 14, 2006 at 04:56:37PM -0400, Hickerson, David A wrote:
> I would suggest, not a vector3 or vector<3>, but to support math with
> 3D transformation matrices, which is 4x4 matrix, with a vector4 or
> vector<4>, if 3 space is the desired representation. When doing
> transformations to vectors, you must use 1 dimension high than the
> level you are working in. If done properly, quaterion support can also

> be obtained, which is another way to represent rotations of vectors.
>
> I believe we need these contruct to work together in a complete
> solution, not just a piece.

I suppose no one said it explicitly, but I'm pretty sure everyone who's