Wednesday, November 15, 2017

How to Rotate Graphs

How to Rotate Graphs

Introduction

The key is to use parametric equations in our rotation.  Using the rotation angle θ, the rotation matrix is:

R = [ [ cos θ, -sin θ ] [ sin θ, cos θ ] ]

With the equations x(t), y(t) set as the matrix:

M = [ [ x(t) ] [ y(t) ] ]

The rotated graph is:

[ [ x’(t) ] [ y’(t) ] ] = R * M

Where:

x’(t) = x(t) * cos θ – y(t) * sin θ
y’(t) = x(t) * sin θ + y(t) * cos θ

Rotation the Function y = f(x)

Let x = t and set the parametric functions:

x(t) = t
y(t) = f(t)

Rotating the Polar Equation r = f(t)  (where t = θ)

1.  Solve for t.
2.  Substitute r and t in the following equations:
  x(t) = r * cos t
  y(t) = r * sin t
3.  Simplify as needed.

Some trigonometric properties:
sin^2 ϕ + cos^2 ϕ = 1
sin(2*ϕ) = 2 * cos ϕ * sin ϕ
cos(2*ϕ) = 2 * cos^2 ϕ – 1
sin(acos ϕ) = cos(asin ϕ) = √(1 – ϕ^2)

Please refer to this link for additional details:  http://edspi31415.blogspot.com/2013/01/converting-polar-equations-to.html
   
Rotation Matrices for Certain Angles

Angle 30°, π/6:  R = [ [ √3/2, -1/2 ] [ 1/2, √3/2 ] ]

Angle 45°, π/4:  R = [ [ √2/2, -√2/2 ] [ √2/2, √2/2 ] ]

Angle 60°, π/3:  R = [ [ 1/2, -√3/2 ] [ √3/2, 1/2 ] ]

Angle 90°, π/2:  R = [ [ 0, -1 ] [ 1, 0 ] ]

Angle 120°, 2π/3:  R = [ [ -1/2, -√3/2 ] [ √3/2, -1/2 ] ]

Angle 135°, 3π/4:  R = [ [ -√2/2, -√2/2 ] [ √2/2, -√2/2 ] ]

Angle 150°, 5π/6:  R = [ [ -√3/2, -1/2 ] [ 1/2, -√3/2 ] ]

Angle 180°, π:  R = [ [ -1, 0 ] [ 0, -1 ] ]

Angle 210°, 7π/6:  R = [ [ -√3/2, 1/2 ] [ -1/2, -√3/2 ] ]

Angle 225°, 5π/4:  R = [ [ -√2/2, √2/2 ] [ -√2/2, -√2/2 ] ]

Angle 240°, 4π/3:  R = [ [ -1/2, √3/2 ] [ -√3/2, -1/2 ] ]

Angle 270°, 3π/2:  R = [  [ 0, 1 ] [ -1, 0 ] ]

Angle 300°, 5π/3:  R = [ [ 1/2, √3/2 ] [ -√3/2, 1/2 ] ]

Angle 315°, 7π/4:  R = [ [ √2/2, √2/2 ] [ -√2/2, √2/2  ] ]

Angle 330°, 11π/6:  R = [ [ √3/2, 1/2 ] [ -1/2, √3/2  ] ]

Examples

Each example is followed by a graph of the original equation (blue) and the rotated equations (red).  I used a Casio fx-CG 50 for the screen shots.

Example 1:  y = 3*x^2, rotate 90°

We have a function in the form of y = f(x).  Let’s transfer the function to parametric form, first by assigning x = t and y = 3*t^2.  Angle mode is in radians.

With 90°, the rotation matrix is:  R = [ [ 0, -1 ] [ 1, 0 ] ]

The transformed equations are:

[ [ 0, -1 ] [ 1, 0 ] ] * [ [ t ] [ 3*t^2 ] ] = [ [ -3*t^2 ] [ t ] ]

Rotated Equations:  x’(t) = -3*t^2, y’(t) = t



Example 2:  x = t^3, y = 2*t – 1, rotate 270°

We have the equations in parametric form.  We’ll need the rotation matrix, where:

R = [  [ 0, 1 ] [ -1, 0 ] ]

[  [ 0, 1 ] [ -1, 0 ] ] * [ [ t^3 ] [ 2*t – 1 ] ] = [ [ 2*t – 1 ] [ -t^3 ] ]

Rotated Equations:  x’(t) = 2*t – 1, y’(t) = -t^3



Example 3:  x = sin t, y = e^t, rotate 135°

The rotation matrix is R = [ [ -√2/2, -√2/2 ] [ √2/2, -√2/2 ] ]

Rotated Equations:  x’(t) = -√2/2 * (sin t + e^t), y’(t) = √2/2 * (sin t – e^t)



Example 4:  r = 2 θ, rotate 60°

The parametric form is x(t) = 2 * t * cos t, y(t) = 2 * t * sin t

The rotation matrix is R = [ [ 1/2, -√3/2 ] [ √3/2, 1/2 ] ]

Rotated Equations: x’(t) = t * cos t - √3 * t * sin t, y’(t) = t * sin t + √3 * t * cos t



Eddie


This blog is property of Edward Shore, 2017

Spotlight: Akron Brass FireCalc Pocket Computer

Spotlight: Akron Brass FireCalc Pocket Computer Welcome to a special Monday Edition of Eddie’s Math and Calculator blog. Thi...