Skip to main content

Latest Post

Power Essence Coefficients and Bernoulli Numbers

Previously, we have explored methods to compute the essence of power functions $Ȣx^n$ which involves solving a large system of linear equations. This method is equivalent to solving for the inverse of a large $n\times n$ matrix where entries are values of pascal's triangle. Though the matrix method allow us to solve for large number of essences at once, it does not extend easily to solve for next iterations of essence coefficients. Rather than reusing the values we have already solved for, we will have to solve for inverse of a separate larger matrix again. Here we will introduce an iterative method for solving for these coefficients. Chapter 0: Recap Let us first remind ourselves of the definition of essence. For a function $f(x)$, we want to find the transformation $Ȣf(x)$ such that we are able to 'smooth out' its series: $$\sum_{i=a}^b f(i) = \int_{a-1}^b Ȣf(x) dx$$ For example, we can solve for the following functions: $$\begin{align*}Ȣ1 &= 1 \\ Ȣx &= x +

Vector Plane Rotation

Vector is a useful tool in maths and in physics that describes both magnitude and direction in a space. Vectors are used to describe concepts where direction matter, such as forces and velocity.
For example, two cars can have same speed(scalar) but if one if heading north and the other south, they will have different velocity(vector).
Vectors are usually written in terms of their components. Components are magnitude of the vector in one dimension. In 2D space, vector can be represented as coordinate of 2 components, <x,y>, and in 3D space, vector can be represented as coordinate of 3 components, <x, y, z>.

Breaking down vectors into their components is extremely useful, especially in physics, because it allows one to break down complicated changes in vector into simpler and easier-to-work-with changes in its components.
Take a look at projectile motion, for example. Velocity of an object fired up into the sky at an angle changes both its direction and magnitude. Attempting to describe how gravity affects these elements may be very challenging.
However, breaking velocity down to simpler horizontal and vertical motion will make describing object's motion over time extremely simpler.
In projectile motion, velocity changes in magnitude and direction. However, only y-component is affected by gravity. 
Knowing that gravity will only affect the vertical motion and knowing that horizontal motion will stay constant when no force is applied in that direction, the question of how velocity change in direction and magnitude turns to how does vertical motion of object change over time.

Breaking down a vector into horizontal and vertical components may be helpful in some problems, but it might not be sufficient in other contexts.
In a collision simulation, storing each particle's velocity can be easily and validly done in horizontal and vertical component, and positions of particles can be easily updated using horizontal and vertical components of velocity vector. However, when collision occurs, unless they collided directly horizontally or vertically, the components in horizontal and vertical dimensions may not be all that helpful in themselves. The components may be more useful if the dimensions were in same angle as the collision itself.
Example of Collision Simulation utilizing Plane Rotation. Both Green components and Black components represent the same Blue Vector. However, during collision, both components in Black changes in magnitude, while for Green only one component changes and the other stays constant. This demonstrates that, even when representing the same vector, some representation may be more helpful then the other(in the case of the example, Green yields easier collision calculation than Black).

The point is, in different situation, different breakdown of vectors may be much more helpful than others. And there isn't a singular "correct" way of breaking down vectors into components. Angle of the dimensions of the plane are chosen arbitrary in attempt to make the problem easier.
So wouldn't it be nice to have a way of rotating the planes of components to angle that you want? To be able to easily represent the same vector only in different angles?
Components of Vector changes depending on Angle of the Plane


Vector Plane Rotation

To study how components change on a plane that is angled differently, we first need a way to keep track of at what angle the current representation of the vector is in. For this, I will use subscript after vector coordinates: 
$$ <x,y>_\theta $$
I will also define $<x,y>_0$ as vector plane that has x-axis that is horizontal and y-axis that is perpendicular to that x-axis.
I will also use same definition of angle as Unit-Circle graph uses; rotation is defined as positive if it is the direction of rotation as positive end of x-axis rotates towards positive end of y-axis.
Or in terms of Right-Hand-Rule, positive rotation is "Out of the Page", and negative rotation is "Into the Page".
Example of Positive Rotation of Plane
I will also define a new operation to signify plane rotation. I will call this Bracket Operation, and it tells us to rotate the current plane by certain angle.
$$[<x, y>_\phi]_\theta = <x',y'>_{\phi+\theta}$$
The Bracket Operation does not change properties of a vector, but rather only changes components lengths to allow coordinates to represent the same vector on a rotated plane.
The Bracket Operation also differs from subscript mentioned above in the way that subscript represents the current angle of the plane and Bracket Operation changes in angle that will be made to the plane.
In simpler analogy, you may think of it like this: on a number line, if Sally stand still on number 8, and Tom is currently standing on number 3 but plans to walk forwards 5 values in positive direction, both Sally and Tom are heading for the same destination. Likewise, subscript marks current position(or more exactly the angle) of the plane and Bracket Operation marks transformation(rotation) that will be operated to the current representation of vector.

Axioms and Corollaries

There are few important points to notice about the Vector Rotation; some axioms we set about the Bracket Operation and some corollaries that naturally follow those rules set.

First axiom about Bracket Operation is that Bracket Operation does not change any property of the vector. Bracket Operation only alters the way the same vectors are represented as coordinates of its components.  (Axiom 1.)
$$
\begin{align*}
\vec{v}\,&=&\,<x,y>_0\,&=&\,<x',y'>_\theta\\
[<x,y>_0]_\theta\,&=&\,<x',y'>_\theta\,&=&\,\vec{v}
\end{align*}
$$
And taking Axiom 1. to be true it naturally follows that magnitude of vector is constant (since magnitude is property of vector) and so hypothenuse of of the components are always constant. (Corollary 1.)
$$
\vec{v}\,=\,<x,y>_0\,=\,<x',y'>_\theta\\
|\vec{v}|\,=\,\sqrt{x^2+y^2}\,=\,\sqrt{x'^2+y'^2}
$$
This point becomes more clear with a diagram.

Another point to notice is that if the current coordinates form a angle $\theta$, then rotating the plane by $\theta$ will result in the new coordinates to have some x-component but no y-component.
$$\forall<x,y>_\phi,\, \text{coordiantes x and y forms angle $\theta$}\Rightarrow\,[<x,y>_\phi]_\theta = <x',0>_{\phi+\theta} \\ \text{by Corollary 1., we also find that}\,x' = \sqrt{x^2+y^2}$$ You can essentially think of this as converting rectangular coordinates to polar coordinates, where $x' = r$.
We can also mention some properties of Bracket Operation.

Additive Property of Bracket Operation: 

$$ [[<x,y>_{\theta}]_{\phi_1}]_{\phi_2} =  [[<x,y>_{\theta}]_{\phi_2}]_{\phi_1} $$
This fact may seem very obvious; order of rotation should not affect the result.
Still, I have come up with little proof for this theorem:

$$ [[<x,y>_{\theta}]_{\phi_1}]_{\phi_2} =  [[<x,y>_{\theta}]_{\phi_2}]_{\phi_1} $$

We will use Proof by Contradiction and first assume that $[[<x,y>_{\theta}]_{\phi_1}]_{\phi_2} \neq [[<x,y>_{\theta}]_{\phi_2}]_{\phi_1}$.
By definition of Bracket Operation, $[[<x,y>_{\theta}]_{\phi_1}]_{\phi_2} =[<x_1,y_1>_{\theta+\phi_1}]_{\phi_2}=<x_2,y_2>_{\theta+\phi_1+\phi_2} $
Likewise, $[[<x,y>_{\theta}]_{\phi_2}]_{\phi_1} =[<x_3,y_3>_{\theta+\phi_2}]_{\phi_1}=<x_4,y_4>_{\theta+\phi_2+\phi_1} $
Both $<x_2,y_2>_{\theta+\phi_1+\phi_2} $ and $<x_4,y_4>_{\theta+\phi_2+\phi_1} $ and on plane of same angle.
However, if we follow our assumption and state that $x_2 \neq x_4 \wedge y_2 \neq y_4$, then the two representation no longer represents the same vector and contradicts with Axiom 1. $\blacksquare$

Plane Angle Independence of Bracket Operation:

This states that Bracket Operation will not be affected by the position of the current plane.  Which again seems very obvious as origin for plane's angle is set arbitrarily in the beginning and only exist to maintain consistency among different representations of a vector.  $$\forall n \in \mathbb{R}, [<x,y>_\theta]_\phi = <x',y'>_{\theta+\phi} \Rightarrow [<x,y>_{\theta+n}]_\phi = <x',y'>_{\theta+\phi+n}$$
Proof for this will be left as an excursive to the readers.

Note that we have proved and defined these properties without even stating how the Bracket Operation actually functions.
Now it is time to see how Bracket Operation actually changes the components.

Bracket Operation

$$[<x,y>_\phi]_\theta\,=\,<x',y'>_{\phi+\theta}$$
We want to define $x'$ and $x'$ in terms of $x,y,$ and $\theta$. The initial angle $\phi$ should not affect $x'$ and $y'$ as mentioned in Plane Angle Independence above.

Let's use diagrams and geometry to see how this works.
Vector $\vec{v}$ represented by components $x$ and $y$ on plane angled at $\phi$. 
 Take an arbitrary vector $\vec{v}$ that can be represented by coordinate $<x,y>_\phi$.
 Draw a new plane's axises angled $\theta$ with respect to the initial x-axis. These are the dimensions on which the new components will be placed on.
 To help us better visually understand relation between initial components and new rotated components, we will rotate our perspective so that angled x-axis is horizontal to our perspective.
 New components are drawn parallel to one of the angled axis. The new coordinate $<x',y'>$ represents the same vector $\vec{v}$ on $\theta$ angled plane.
Note that initial components $x$ and $y$ now act as vectors in themselves on the new angled plane. Sum of $x$ and $y$ also point to the same point on the plane as sum of $x'$ and $y'$.
This means that sum of horizontal components of $x$ and $y$ equals $x'$ and sum of vertical components equals $y'$.
Construct line parallel to new horizontal axis at the head of $x$ and construct line parallel to new vertical axis as the head of $y$.
 Because of Alternate Interior Angles and Right Triangles, we know that $x$ and $y$ forms angle $\theta$ with new horizontal axis and new vertical axis respectively.
Now with all necessary elements marked, we can finally solve for $x'$ and $y'4$.
As mentioned above, $x'$ is sum of horizontal components of $x$ and $y$, which are marked $x\_x$ and $y\_x$ respectively. Likewise, $y'$ is sum of vertical components of $x$ and $y$, which are marked $x\_y$ and $y\_y$ respectively.
$$\begin{align*}x'=&\,x\_x+y\_x\\y'=&\,x\_y+y\_y\\&x\_x =x\cos(\theta)\\ &x\_y= -x\sin(\theta)\\&y\_x= y\sin(\theta)\\&y\_y= y\cos(\theta)\\\therefore x' = & x\cos(\theta)+y\sin(\theta)\\\therefore y' = &-x\sin(\theta)+y\cos(\theta) \end{align*}$$
With this, we can finally define Bracket Operation:
$$[<x,\,y>_\phi]_\theta\,=\,<x\cos(\theta)+y\sin(\theta),\,-x\sin(\theta)+y\cos(\theta)>_{\phi+\theta} \,\blacksquare$$

Alternative Proof

So far, we strictly used rectangular coordination to show how Bracket Operation changes components. However, since we are dealing with angles and rotations, some of you may have already noticed that Polar Coordinates may be easier to work with in this situation. 
In Polar Coordinates, Bracket Operation will have following property:
Plane Rotation in Polar Coordinates
$$ [(r,\phi_1)_{\phi_2}]_\theta = (r,\phi_1-\theta)_{\phi_2+\theta} $$ Also note that for the same vector, radius is always constant, and sum of Angular Coordinate and Angle of current Plane is constant.  $$(r_1,\phi_1)_{\theta_1} = (r_2,\phi_2)_{\theta_2} \Rightarrow r_1 = r_2 \wedge \phi_1+\theta_1=\phi_2+\theta_2$$
Even with Polar Coordinates, we can still reach the same conclusion that $[<x,\,y>_\phi]_\theta\,=\,<x\cos(\theta)+y\sin(\theta),\,-x\sin(\theta)+y\cos(\theta)>_{\phi+\theta}$:
Lets take arbitrary vector $\vec{v}$ which can be represented by Rectangular Coordinate $<x,y>_\phi$.
The Rectangular Coordinate can be represented as Polar Coordinate as such: $$\begin{align*}<x,y>_\phi&= (r,\theta_1)_\phi\\
x &= r\cos(\theta_1)\\ y &= r\sin(\theta_1) \end{align*}$$
Now we rotate plane of both representation by $\theta_2$. $$[<x,y>_\phi]_{\theta_2}=<x',y'>_{\phi+\theta_2}\\ [(r,\theta_1)_\phi]_{\theta_2} = (r,\theta_1 - \theta_2)_{\phi+\theta_2}$$
Since $<x',y'>_{\phi+\theta_2}$ is Rectangular representation of Polar $ (r,\theta_1 - \theta_2)_{\phi+\theta_2}$ and both representations are on same angled plane, it follows that
$$\begin{align*}x' &= r\cos(\theta_1-\theta_2)\\ y' &= r\sin(\theta_1-\theta_2) \end{align*}$$
By Ptolemy's Identity and previous definitions we find that
$$\begin{align*}x' &= r\cos(\theta_1-\theta_2)\\ &=r( \,\cos(\theta_1)\cos(\theta_2) + \sin(\theta_1)\sin(\theta_2)  \,)\\ &=x\cos(\theta_2)+y\sin(\theta_2)\\ y' &= r\sin(\theta_1-\theta_2) \\&=r(\, \sin(\theta_1)\cos(\theta_2)-\cos(\theta_1)\sin(\theta_2) \,)\\&=y\cos(\theta_2)-x\sin(\theta_2) \end{align*}$$ which is consistent with definition that we have found using Rectangular Coordinates. $\blacksquare$.

Applications of Vector Plane Rotation

Collision Simulation

As mentioned in the introduction, one of the usage for Bracket Operation and my personal motivation to develop this operation is to help simulate collisions from any angle. 
Each particle in my simulation had horizontal and vertical speed, but during collision having velocity of particle be represented as horizontal and vertical components weren't very helpful. Velocity is only affected in the direction of the collision, and so applying Collision Equations from physics 1 each components separately will make it seem as if particles are always colliding both vertically and horizontally at the same time. 
Correct Collision. Collision only calculated for Vector component in Angle of Collision. Wrong Collision. Collision calculated for both horizontal and vertical components. 
By using Vector Plane Rotation, I was able to resolve this issue.
You first find the angle of collision with respect to the horizon, $\theta$. 
Then using Bracket Operation, rotate the plane by the angle of collision, $\theta$. This yields a new coordinate with x-component in direction of collision and y-component being perpendicular to collision.
Since the y-component is now perpendicular to collision, it will not be affected by collision and can be ignored. 
Calculate collision for x-component. Now together with unaltered y-component, new velocity vector is found. 
Now, rotate the the new components back by $-\theta$. This will yield horizontal x-component and vertical y-component with correctly calculated collision. 

Graph Rotation

Anther interesting uses for Bracket Operation is that you can use transformation used on each components to rotate a graph.
Try it out for yourself in Desmos
Given a function $f(x)$, by substituting $y$ with $-x\sin(\theta)+y\cos(\theta)$ and substituting $x$ with $x\cos(\theta)+y\sin(\theta)$, you can rotate the graph by $\theta$. Substituting to achieve rotation will also work with Relations that is not a function, such as Conic Sections.
You can also rotate the plane by $\frac{\pi}{2}$ and substitute $y$ with $-(\,-x\sin(\theta)+y\sin(\theta)\,)$ instead to get inverse graphs. This will works because rotating by $\frac{\pi}{2}$ will put x-axis in place of y-axis, and y-axis in place of x-axis but with positive y facing negative x direction. 

Vector Rotation

So far we talked about rotating planes, but we can modify the equations just a little to be able to rotate vectors. You may have noticed that rotating the plane by positive $\theta$ will decrease the angle formed by the components by $\theta$
This means that you can calculate components of rotate vector by using Bracket Operation but with $-\theta$.
$$\begin{align*}<x,y>_\phi \text{ rotated by }\theta& = \,<&x\cos(\,-\theta)&+y\sin(\,-\theta),&-x\sin(\,-\theta)&+y\cos(\,-\theta)&>_\phi\\&=\,<& x\cos(\theta)&-y\sin(\theta),&x\sin(\theta)&+y\cos(\theta) &>_\phi \end{align*}$$ 

Endnote

Thanks for coming along on my little journey through Vector Plane Rotation. This turned out way longer than I had expected. I hope you found at least something that interested you( maybe the equations, maybe rotating the graphs). This, as you'll see by the date, is first post on my blog and I'm still figuring out how I should write and present my math findings. I'll be back again soon with more concise and more interesting topics.
If you have been, thanks for reading!

Comments

Popular posts from this blog

Large Polynomial Series using Matrices (Calculating Bernoulli's Number with Pascal Matrix)

Polynomial Series can be easily solved using Power Series Formulas for each term in the polynomial. However, this can be frustrating since not every Power Formula are intuitive to memorize. We would like to find a more elegant and easier-to-recall formula for computing a Polynomial Series. This can be done using matrices. Notations and Equations We will borrow the notations and simple equations from Sequence Curve articles . There, we have extended a series to be continuous through the following identity: $$\sum_{i=m}^n f(i) = \int_{m-1}^nȢ\{f(x)\}dx $$ The $Ȣ\{f(x)\}$ acts as the rate of change of a series relative to its bounds. $$\frac{d}{dt} \sum_{i=m}^nf(i) = Ȣ\{f(n)\}\frac{dn}{dt} - Ȣ\{f(m-1)\}\frac{dm}{dt}$$ Letting $t=m=n$, we find $$\frac{d}{dt} \sum_{i=t}^tf(i) = \frac{d}{dt}f(t)= Ȣ\{f(t)\} - Ȣ\{f(t-1)\} $$ Remebering that $Ȣ$ Transformation is Linear, we can derive a simple identity of $$\frac{d}{dx}f(x+1) = Ȣ\{f(x+1)\} - Ȣ\{f(x)\} = Ȣ\{f(x+1)-f(x)\}$$ This will be use

Partition Counter using Trees, Recursion, Tables, and Algorithm

Partitions are number of ways an integer can be represented as sum of positive integers. We can ask, for example, what is the partition of 5? If we write out every possible combination, $$\begin{align*}  5 &= 1+1+1+1+1 \\  &= 1+1+1+2\\ &= 1+1+3\\ &= 1+4\\ &= 1+2+2\\ &= 2+3\\  &= 5 \end{align*} $$ we can see that partition of 5 is 7. One will immediately notice, however, that this is not the most efficient approach to answering the question: not only does partition grow quickly, attempting to organize and not miss or repeat an algebraic expression becomes messy and impractical. Chapter 1: Partition Tree A cleaner, but still not the best, approach would be to use tree diagrams to represent the partitions of a number. In a Partition Tree of $n$, every path to a terminating node will add up to the number $n$. And also, every child of a node (every nodes below a given parent node) will always be greater than or equal to the parent node in order to not

Summation of Harmonic Interval and Simplified Riemann Sum

When you first learn of Summation in Pre-Calc class, it is probably in build-up to Riemann Sum. You are taught the basics of Summation and simple manipulations, such a $\sum_nc*a_n = c*\sum_na_a$ for constant $c$, but you don't get to explore deeper into Summations and really play around with it. One thing that really intrigued me was why Summations only incremented by a unit. When we have a Sum like $\sum_{n=3}^{10}a_n$, it is equal to $a_3+a_4+a_5+\dots+a_9+a_{10}$, always incrementing by a unit( $1$ ). Why couldn't we Sum with interval that is not a unit? How could we have something like $a_3+a_{3.5}+a_4+a_{4.5}+a_5+a_{5.5}+\dots+a_{8.5}+a_9+a_{9.5}+a_{10}$, incrementing by a half instead of a full unit? Sets Of course you technically can use Sets and Set Builder Notation to create a specific Summation. $$\sum_{i \in S}i,S=\{\frac{x}{2}|x\in\mathbb{N_0}\} \, = \, 0+\frac{1}{2}+1+\frac{3}{2}+\dots$$ The above is Sum of all Rational Numbers incrementing by $\frac{1