http://www.mathworks.com/matlabcentral/newsreader/view_thread/241974
MATLAB Central Newsreader  Regarding affine transormation using maketform
Feed for thread: Regarding affine transormation using maketform
enus
©19942015 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Tue, 06 Jan 2009 21:33:02 +0000
Regarding affine transormation using maketform
http://www.mathworks.com/matlabcentral/newsreader/view_thread/241974#620174
Gautam
Hello,<br>
<br>
I am trying to write MATLAB code to rotate a point in 3space about an arbitrary axis. I have based my code on this article  <a href="http://local.wasp.uwa.edu.au/~pbourke/geometry/rotate/">http://local.wasp.uwa.edu.au/~pbourke/geometry/rotate/</a>. The problem I am facing is that the maketform function expects the last column to comprise of all 0's except the last element in the last row which has to be a 1 for affine transformation. However, my composite transformation matrix does not adhere to this requirement. I am not sure I understand why the maketform function expects the last column to comprise of all 0s for an affine transformation. Any information on how to get around this problem would be appreciated. <br>
<br>
 Gautam.

Wed, 07 Jan 2009 01:00:04 +0000
Regarding affine transormation using maketform
http://www.mathworks.com/matlabcentral/newsreader/view_thread/241974#620190
Roger Stafford
"Gautam " <gautam.s.muralidhar@gmail.com> wrote in message <gk0ime$8f1$1@fred.mathworks.com>...<br>
> .......<br>
> I am trying to write MATLAB code to rotate a point in 3space about an arbitrary axis. > .......<br>
<br>
I like to think of rotation in terms of the dot and cross (inner and vector) products of vector analysis. If the axis of rotation points in a positive sense along the line from P1 = [x1,y1,z1] to P2 = [x2,y2,z2], and if the point Q = [x,y,z] is to undergo a righthand rotation by angle theta about this axis, then it will move to the point R as given by:<br>
<br>
u = (P2P1)/norm(P2P1);<br>
QP = QP1;<br>
W = cross(u,QP);<br>
R = P1 + dot(QP,u)*u + cross(W,u)*cos(theta) + W*sin(theta);<br>
<br>
To get an insight into this last expression, the three righthand oriented vectors dot(QP,u)*u, cross(W,u), and W are mutually orthogonal with QP being the sum of the first two. (The equality QP = dot(QP,u)*u + cross(W,u) is an identity.) The vectors cross(W,u) and W have the same magnitude. The rotation through angle theta preserves the first of these components while rotating the remaining component in a circle lying in a plane parallel to the second and third vectors, cross(W,u) and W, so the one is multiplied by cos(theta) and the other by sin(theta).<br>
<br>
Roger Stafford

Wed, 07 Jan 2009 12:27:17 +0000
Re: Regarding affine transormation using maketform
http://www.mathworks.com/matlabcentral/newsreader/view_thread/241974#620258
Steve Eddins
Gautam wrote:<br>
> Hello,<br>
> <br>
> I am trying to write MATLAB code to rotate a point in 3space about an<br>
> arbitrary axis. I have based my code on this article <br>
> <a href="http://local.wasp.uwa.edu.au/~pbourke/geometry/rotate/">http://local.wasp.uwa.edu.au/~pbourke/geometry/rotate/</a>. The problem I am<br>
> facing is that the maketform function expects the last column to<br>
> comprise of all 0's except the last element in the last row which has to<br>
> be a 1 for affine transformation. However, my composite transformation<br>
> matrix does not adhere to this requirement. I am not sure I understand<br>
> why the maketform function expects the last column to comprise of all 0s<br>
> for an affine transformation. Any information on how to get around this<br>
> problem would be appreciated.<br>
> <br>
>  Gautam.<br>
<br>
In the article at the link you provided, the transform matrices are <br>
transposed from the convention used by the Image Processing Toolbox. <br>
Notice in that article that the bottom row is all 0s except the last <br>
element, which is 1.<br>
<br>
<br>
Steve Eddins<br>
<a href="http://blogs.mathworks.com/steve/">http://blogs.mathworks.com/steve/</a>