Express rotation of a vector by another vector, without any angles.
Rotate a Vector
The point {Cos[a],Sin[a]} is a point with a angle with the positive x-axis and 1 unit distant from the origin.
To rotate it by angle b, then new coordinate is {Cos[a+b],Sin[a+b]}.
By trig identity of sum of angles:
Simplify[ Cos[a+b] == Cos[a] Cos[b] - Sin[a] Sin[b] ] (* True *)
and
Simplify[ Sin[a+b] == Cos[a] Sin[b] + Cos[b] Sin[a] ] (* True *)
, we can then write our rotated point as
{Cos[a] Cos[b] - Sin[a] Sin[b], Cos[a] Sin[b] + Cos[b] Sin[a]}
Now, look at the components in the above coordinate.
They are of the form sine and cosine.
If we define point A as {Cos[a],Sin[a]} and point B as {Cos[b],Sin[b]}.
Then, the point A rotated by b angles can be written in terms of the coordinates of A and B.
In other words, if A is {a,b} and B is {c,d} and suppose both are 1 unit distant from the origin, then a new point C, obtained by rotating A by B's angle, can be expressed in terms of coordinate components of A and B by this expression:
{a c-b d, a d+b c}
But now if we substitute a by r*a and b by r*b and c by s*c and d by s*d.
In other words, we start with points {r a,r b} which is r distant to the origin, and point {s c,s d} which is s distant.
Then, the above formula gives us
{r s (a c-b d), r s (a d+b c)}
From this, we can say that length of the new vector is just the product of the lengths of the old vectors.
In summary, if A is {a,b} with angle a and length r, and B is {c,d} with angle b and length s, then {a c-b d, a d+b c} is a point with angle a+b and length r*s.
This formula is extremely powerful, because it lets us do rotation and scaling around the origin at the same time, and by simply using another vector.
Note About Complex Numbers
Note: rotating one vector by another, is exactly how multiplication of 2 complex numbers is defined.
You can think of complex number a+b ⅈ as vector {a,b}.
The definition of multiplication of 2 complex numbers is exactly the definition of rotating one vector by another.
That is, the multplication of complex number a+b ⅈ and c+d ⅈ is defined to be {a c - b d, (a d + b c) ⅈ}.
You can see that it's the same as rotation of vectors, expressed by the vector's coordinate components.
Rotating a Curve defined by a Equation
Let f[x,y]==0 be the equation for a curve in rectangular coordinates.
Suppose we want to rotate it by a angle θ. First, we find a vector {c,d} of distance 1 having angle -θ, which is {Cos[-θ], Sin[-θ]}. Then, we do this substitution into the function:
x → x c - y d y → x d + y c
so we obtain:
f[x c - y d, x d + y c]
This would be the new curve we wanted. If the vector {c,d} has length r, then the new curve would be dilated by 1/r.
Example
Suppose:
f[x_,y_] := (x-1)^2+y^2-1
Then, f[x,y]==0 is a circle centered on {1,0} with radius 1.
Let's say we want to rotate it by angle θ represented by the vector {2,1}.
So, we should use a vector that has angle -θ, which is {2,-1}.
So, {c,d}:={2,-1}.
Now, we substitute the rotation with our formula
x → x 2 - y (-1) y → x (-1) + y 2
So our new function is:
g[x_,y_] := ((x 2 - y (-1))-1)^2 + ( x (-1) + y 2)^2-1
Then, g[x,y]==0 is our old circle rotated. Note that it is also shrinked. This is because the vector we used {2,-1} has a length greater than 1. If we want to keep the circle the same size, we should use a vector with length 1, which is {Cos[-θ],Sin[-θ]}.
Let
f[r,θ]==0
be the equation for a curve in polar coordinate.
To rotate it by a, the new formula is
f[r,θ-a]==0.
Let
{f[t],g[t]}
be the parametric formula for a curve in rectangular coordinate.
To rotate the curve by θ radian, the new formula is
{Cos[θ]*f[t] - g[t]*Sin[θ], Cos[θ]*g[t] + f[t]*Sin[θ]}
or, if {c,d} is a unit vector with θ radians,
the new rotated curve expressed in terms of {c,d} is
{f[t]*c-g[t]*d, f[t]*d+g[t]*c}.
Let
{r[t],φ[t]}
be the parametric formula for a curve in polar coordinate.
To rotate the curve by θ, the new formula would be:
{r[t],φ[t]+θ}.