Rotation Matrix and of rotation around a point
Clash Royale CLAN TAG#URR8PPP
up vote
11
down vote
favorite
In homogeneous coordinates, a rotation matrix around the origin can be described as
$R = beginbmatrixcos(theta) & -sin(theta) & 0\sin(theta) & cos(theta) & 0 \ 0&0&1endbmatrix$
with the angle $theta$ and the rotation being counter-clockwise.
A translation amongst $x$ and $y$ can be defined as:
$T(x,y) = beginbmatrix1&0&x\ 0& 1&y\0&0&1endbmatrix$
As I understand, the rotation matrix around an arbitrary point, can be expressed as moving the rotation point to the origin, rotating around the origin and moving back to the original position. Is it true, that this operations can be described in a simple multiplication of
$T(x,y) * R * T(-x,-y) qquad (I)$
I find this to be counter-intuitive. In my understanding, it should be
$T(-x,-y) * R * T(x,y) qquad (II)$
Update:
The two formulations are definitely not equal.
The first equation yields
$E1 = beginbmatrixcos(theta) & -sin(theta) & -xcdotcos(theta)+x+ycdotsin(theta)\sin(theta) & cos(theta) & -xcdotsin(theta)-ycdotcos(theta)+y \ 0&0&1endbmatrix$
The second one:
$E2 = beginbmatrixcos(theta) & -sin(theta) & xcdotcos(theta)-x-ycdotsin(theta)\sin(theta) & cos(theta) & xcdotsin(theta)+ycdotcos(theta)-y \ 0&0&1endbmatrix$
matrices rotations affine-geometry homogeneous-spaces
add a comment |Â
up vote
11
down vote
favorite
In homogeneous coordinates, a rotation matrix around the origin can be described as
$R = beginbmatrixcos(theta) & -sin(theta) & 0\sin(theta) & cos(theta) & 0 \ 0&0&1endbmatrix$
with the angle $theta$ and the rotation being counter-clockwise.
A translation amongst $x$ and $y$ can be defined as:
$T(x,y) = beginbmatrix1&0&x\ 0& 1&y\0&0&1endbmatrix$
As I understand, the rotation matrix around an arbitrary point, can be expressed as moving the rotation point to the origin, rotating around the origin and moving back to the original position. Is it true, that this operations can be described in a simple multiplication of
$T(x,y) * R * T(-x,-y) qquad (I)$
I find this to be counter-intuitive. In my understanding, it should be
$T(-x,-y) * R * T(x,y) qquad (II)$
Update:
The two formulations are definitely not equal.
The first equation yields
$E1 = beginbmatrixcos(theta) & -sin(theta) & -xcdotcos(theta)+x+ycdotsin(theta)\sin(theta) & cos(theta) & -xcdotsin(theta)-ycdotcos(theta)+y \ 0&0&1endbmatrix$
The second one:
$E2 = beginbmatrixcos(theta) & -sin(theta) & xcdotcos(theta)-x-ycdotsin(theta)\sin(theta) & cos(theta) & xcdotsin(theta)+ycdotcos(theta)-y \ 0&0&1endbmatrix$
matrices rotations affine-geometry homogeneous-spaces
add a comment |Â
up vote
11
down vote
favorite
up vote
11
down vote
favorite
In homogeneous coordinates, a rotation matrix around the origin can be described as
$R = beginbmatrixcos(theta) & -sin(theta) & 0\sin(theta) & cos(theta) & 0 \ 0&0&1endbmatrix$
with the angle $theta$ and the rotation being counter-clockwise.
A translation amongst $x$ and $y$ can be defined as:
$T(x,y) = beginbmatrix1&0&x\ 0& 1&y\0&0&1endbmatrix$
As I understand, the rotation matrix around an arbitrary point, can be expressed as moving the rotation point to the origin, rotating around the origin and moving back to the original position. Is it true, that this operations can be described in a simple multiplication of
$T(x,y) * R * T(-x,-y) qquad (I)$
I find this to be counter-intuitive. In my understanding, it should be
$T(-x,-y) * R * T(x,y) qquad (II)$
Update:
The two formulations are definitely not equal.
The first equation yields
$E1 = beginbmatrixcos(theta) & -sin(theta) & -xcdotcos(theta)+x+ycdotsin(theta)\sin(theta) & cos(theta) & -xcdotsin(theta)-ycdotcos(theta)+y \ 0&0&1endbmatrix$
The second one:
$E2 = beginbmatrixcos(theta) & -sin(theta) & xcdotcos(theta)-x-ycdotsin(theta)\sin(theta) & cos(theta) & xcdotsin(theta)+ycdotcos(theta)-y \ 0&0&1endbmatrix$
matrices rotations affine-geometry homogeneous-spaces
In homogeneous coordinates, a rotation matrix around the origin can be described as
$R = beginbmatrixcos(theta) & -sin(theta) & 0\sin(theta) & cos(theta) & 0 \ 0&0&1endbmatrix$
with the angle $theta$ and the rotation being counter-clockwise.
A translation amongst $x$ and $y$ can be defined as:
$T(x,y) = beginbmatrix1&0&x\ 0& 1&y\0&0&1endbmatrix$
As I understand, the rotation matrix around an arbitrary point, can be expressed as moving the rotation point to the origin, rotating around the origin and moving back to the original position. Is it true, that this operations can be described in a simple multiplication of
$T(x,y) * R * T(-x,-y) qquad (I)$
I find this to be counter-intuitive. In my understanding, it should be
$T(-x,-y) * R * T(x,y) qquad (II)$
Update:
The two formulations are definitely not equal.
The first equation yields
$E1 = beginbmatrixcos(theta) & -sin(theta) & -xcdotcos(theta)+x+ycdotsin(theta)\sin(theta) & cos(theta) & -xcdotsin(theta)-ycdotcos(theta)+y \ 0&0&1endbmatrix$
The second one:
$E2 = beginbmatrixcos(theta) & -sin(theta) & xcdotcos(theta)-x-ycdotsin(theta)\sin(theta) & cos(theta) & xcdotsin(theta)+ycdotcos(theta)-y \ 0&0&1endbmatrix$
matrices rotations affine-geometry homogeneous-spaces
edited Jan 11 '17 at 13:38
asked Jan 11 '17 at 13:24
Dschoni
179110
179110
add a comment |Â
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
11
down vote
accepted
Your first formula is correct. Remember, the point to which this is applied appears on the RIGHT:
$$
T(x,y) * R * T(-x,-y) (P)
$$
So to evaluate the expression above, we first translate $P$ by $(-x, -y)$, then rotate the result, then translate back. Let's see what happens when $P$ is the point $(x, y, 1)$. That amounts to evaluating the following product:
beginalign
f((x, y))
&= beginbmatrix1&0&x\ 0& 1&y\0&0&1endbmatrix
beginbmatrixcos(theta) & -sin(theta) & 0\sin(theta) & cos(theta) & 0 \ 0&0&1endbmatrix
beginbmatrix1&0&-x\ 0& 1&-y\0&0&1endbmatrix
beginbmatrixx\ y\1endbmatrix\
&= beginbmatrix1&0&x\ 0& 1&y\0&0&1endbmatrix
beginbmatrixcos(theta) & -sin(theta) & 0\sin(theta) & cos(theta) & 0 \ 0&0&1endbmatrix
beginbmatrix0\ 0\1endbmatrix\
&= beginbmatrix1&0&x\ 0& 1&y\0&0&1endbmatrix
beginbmatrix0\ 0\1endbmatrix\
&= beginbmatrixx\ y\1endbmatrix\
endalign
as expected: the point $(x, y)$ remains fixed by this composite transformation.
add a comment |Â
up vote
5
down vote
These matrices are left-side multiplicated with vector positions, so the order of multiplication is from right to left - on the right side is the first operation, on the left side - the last one.
add a comment |Â
up vote
5
down vote
The point is, that you're shifting the coordinate system, not the point.
So you don't actually shift the point to the origin, you shift the origin to the point, and then back.
Regardless of whether you think of the math as "shifting the coordinate system" or "shifting the point", the first operation you apply, as John Hughes correctly explains, is T(-x, -y). If that transform is applied to the point, the result is (0, 0). IMHO its simpler to get this math correct, if you think of this operation as "shifting the point to the origin". Hmm, or maybe you are working with post-multiplications rather than pre-multiplications. So its a question of POV.
â ToolmakerSteve
Mar 22 at 14:09
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
11
down vote
accepted
Your first formula is correct. Remember, the point to which this is applied appears on the RIGHT:
$$
T(x,y) * R * T(-x,-y) (P)
$$
So to evaluate the expression above, we first translate $P$ by $(-x, -y)$, then rotate the result, then translate back. Let's see what happens when $P$ is the point $(x, y, 1)$. That amounts to evaluating the following product:
beginalign
f((x, y))
&= beginbmatrix1&0&x\ 0& 1&y\0&0&1endbmatrix
beginbmatrixcos(theta) & -sin(theta) & 0\sin(theta) & cos(theta) & 0 \ 0&0&1endbmatrix
beginbmatrix1&0&-x\ 0& 1&-y\0&0&1endbmatrix
beginbmatrixx\ y\1endbmatrix\
&= beginbmatrix1&0&x\ 0& 1&y\0&0&1endbmatrix
beginbmatrixcos(theta) & -sin(theta) & 0\sin(theta) & cos(theta) & 0 \ 0&0&1endbmatrix
beginbmatrix0\ 0\1endbmatrix\
&= beginbmatrix1&0&x\ 0& 1&y\0&0&1endbmatrix
beginbmatrix0\ 0\1endbmatrix\
&= beginbmatrixx\ y\1endbmatrix\
endalign
as expected: the point $(x, y)$ remains fixed by this composite transformation.
add a comment |Â
up vote
11
down vote
accepted
Your first formula is correct. Remember, the point to which this is applied appears on the RIGHT:
$$
T(x,y) * R * T(-x,-y) (P)
$$
So to evaluate the expression above, we first translate $P$ by $(-x, -y)$, then rotate the result, then translate back. Let's see what happens when $P$ is the point $(x, y, 1)$. That amounts to evaluating the following product:
beginalign
f((x, y))
&= beginbmatrix1&0&x\ 0& 1&y\0&0&1endbmatrix
beginbmatrixcos(theta) & -sin(theta) & 0\sin(theta) & cos(theta) & 0 \ 0&0&1endbmatrix
beginbmatrix1&0&-x\ 0& 1&-y\0&0&1endbmatrix
beginbmatrixx\ y\1endbmatrix\
&= beginbmatrix1&0&x\ 0& 1&y\0&0&1endbmatrix
beginbmatrixcos(theta) & -sin(theta) & 0\sin(theta) & cos(theta) & 0 \ 0&0&1endbmatrix
beginbmatrix0\ 0\1endbmatrix\
&= beginbmatrix1&0&x\ 0& 1&y\0&0&1endbmatrix
beginbmatrix0\ 0\1endbmatrix\
&= beginbmatrixx\ y\1endbmatrix\
endalign
as expected: the point $(x, y)$ remains fixed by this composite transformation.
add a comment |Â
up vote
11
down vote
accepted
up vote
11
down vote
accepted
Your first formula is correct. Remember, the point to which this is applied appears on the RIGHT:
$$
T(x,y) * R * T(-x,-y) (P)
$$
So to evaluate the expression above, we first translate $P$ by $(-x, -y)$, then rotate the result, then translate back. Let's see what happens when $P$ is the point $(x, y, 1)$. That amounts to evaluating the following product:
beginalign
f((x, y))
&= beginbmatrix1&0&x\ 0& 1&y\0&0&1endbmatrix
beginbmatrixcos(theta) & -sin(theta) & 0\sin(theta) & cos(theta) & 0 \ 0&0&1endbmatrix
beginbmatrix1&0&-x\ 0& 1&-y\0&0&1endbmatrix
beginbmatrixx\ y\1endbmatrix\
&= beginbmatrix1&0&x\ 0& 1&y\0&0&1endbmatrix
beginbmatrixcos(theta) & -sin(theta) & 0\sin(theta) & cos(theta) & 0 \ 0&0&1endbmatrix
beginbmatrix0\ 0\1endbmatrix\
&= beginbmatrix1&0&x\ 0& 1&y\0&0&1endbmatrix
beginbmatrix0\ 0\1endbmatrix\
&= beginbmatrixx\ y\1endbmatrix\
endalign
as expected: the point $(x, y)$ remains fixed by this composite transformation.
Your first formula is correct. Remember, the point to which this is applied appears on the RIGHT:
$$
T(x,y) * R * T(-x,-y) (P)
$$
So to evaluate the expression above, we first translate $P$ by $(-x, -y)$, then rotate the result, then translate back. Let's see what happens when $P$ is the point $(x, y, 1)$. That amounts to evaluating the following product:
beginalign
f((x, y))
&= beginbmatrix1&0&x\ 0& 1&y\0&0&1endbmatrix
beginbmatrixcos(theta) & -sin(theta) & 0\sin(theta) & cos(theta) & 0 \ 0&0&1endbmatrix
beginbmatrix1&0&-x\ 0& 1&-y\0&0&1endbmatrix
beginbmatrixx\ y\1endbmatrix\
&= beginbmatrix1&0&x\ 0& 1&y\0&0&1endbmatrix
beginbmatrixcos(theta) & -sin(theta) & 0\sin(theta) & cos(theta) & 0 \ 0&0&1endbmatrix
beginbmatrix0\ 0\1endbmatrix\
&= beginbmatrix1&0&x\ 0& 1&y\0&0&1endbmatrix
beginbmatrix0\ 0\1endbmatrix\
&= beginbmatrixx\ y\1endbmatrix\
endalign
as expected: the point $(x, y)$ remains fixed by this composite transformation.
answered Jan 11 '17 at 13:33
John Hughes
59.5k23786
59.5k23786
add a comment |Â
add a comment |Â
up vote
5
down vote
These matrices are left-side multiplicated with vector positions, so the order of multiplication is from right to left - on the right side is the first operation, on the left side - the last one.
add a comment |Â
up vote
5
down vote
These matrices are left-side multiplicated with vector positions, so the order of multiplication is from right to left - on the right side is the first operation, on the left side - the last one.
add a comment |Â
up vote
5
down vote
up vote
5
down vote
These matrices are left-side multiplicated with vector positions, so the order of multiplication is from right to left - on the right side is the first operation, on the left side - the last one.
These matrices are left-side multiplicated with vector positions, so the order of multiplication is from right to left - on the right side is the first operation, on the left side - the last one.
answered Jan 11 '17 at 13:39
Jaroslaw Matlak
3,900830
3,900830
add a comment |Â
add a comment |Â
up vote
5
down vote
The point is, that you're shifting the coordinate system, not the point.
So you don't actually shift the point to the origin, you shift the origin to the point, and then back.
Regardless of whether you think of the math as "shifting the coordinate system" or "shifting the point", the first operation you apply, as John Hughes correctly explains, is T(-x, -y). If that transform is applied to the point, the result is (0, 0). IMHO its simpler to get this math correct, if you think of this operation as "shifting the point to the origin". Hmm, or maybe you are working with post-multiplications rather than pre-multiplications. So its a question of POV.
â ToolmakerSteve
Mar 22 at 14:09
add a comment |Â
up vote
5
down vote
The point is, that you're shifting the coordinate system, not the point.
So you don't actually shift the point to the origin, you shift the origin to the point, and then back.
Regardless of whether you think of the math as "shifting the coordinate system" or "shifting the point", the first operation you apply, as John Hughes correctly explains, is T(-x, -y). If that transform is applied to the point, the result is (0, 0). IMHO its simpler to get this math correct, if you think of this operation as "shifting the point to the origin". Hmm, or maybe you are working with post-multiplications rather than pre-multiplications. So its a question of POV.
â ToolmakerSteve
Mar 22 at 14:09
add a comment |Â
up vote
5
down vote
up vote
5
down vote
The point is, that you're shifting the coordinate system, not the point.
So you don't actually shift the point to the origin, you shift the origin to the point, and then back.
The point is, that you're shifting the coordinate system, not the point.
So you don't actually shift the point to the origin, you shift the origin to the point, and then back.
edited Aug 16 at 6:56
answered May 22 '17 at 10:57
Quandary
15114
15114
Regardless of whether you think of the math as "shifting the coordinate system" or "shifting the point", the first operation you apply, as John Hughes correctly explains, is T(-x, -y). If that transform is applied to the point, the result is (0, 0). IMHO its simpler to get this math correct, if you think of this operation as "shifting the point to the origin". Hmm, or maybe you are working with post-multiplications rather than pre-multiplications. So its a question of POV.
â ToolmakerSteve
Mar 22 at 14:09
add a comment |Â
Regardless of whether you think of the math as "shifting the coordinate system" or "shifting the point", the first operation you apply, as John Hughes correctly explains, is T(-x, -y). If that transform is applied to the point, the result is (0, 0). IMHO its simpler to get this math correct, if you think of this operation as "shifting the point to the origin". Hmm, or maybe you are working with post-multiplications rather than pre-multiplications. So its a question of POV.
â ToolmakerSteve
Mar 22 at 14:09
Regardless of whether you think of the math as "shifting the coordinate system" or "shifting the point", the first operation you apply, as John Hughes correctly explains, is T(-x, -y). If that transform is applied to the point, the result is (0, 0). IMHO its simpler to get this math correct, if you think of this operation as "shifting the point to the origin". Hmm, or maybe you are working with post-multiplications rather than pre-multiplications. So its a question of POV.
â ToolmakerSteve
Mar 22 at 14:09
Regardless of whether you think of the math as "shifting the coordinate system" or "shifting the point", the first operation you apply, as John Hughes correctly explains, is T(-x, -y). If that transform is applied to the point, the result is (0, 0). IMHO its simpler to get this math correct, if you think of this operation as "shifting the point to the origin". Hmm, or maybe you are working with post-multiplications rather than pre-multiplications. So its a question of POV.
â ToolmakerSteve
Mar 22 at 14:09
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2093314%2frotation-matrix-and-of-rotation-around-a-point%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password