Transformation of Coordinates

Translation of Coordinate Axes

edit
 
Graph in 2 dimensions illustrating Translation of Coordinate Axes.
Points   are same point.
Point   is defined relative to origin   black arrows.
Point   is defined relative to origin   red arrows.

Any point in the 2 dimensional Cartesian plane is usually defined as   meaning that the point is   units horizontally from origin   and   units vertically from origin.

It is always possible, and sometimes desirable, to give the point a new name or definition that reflects its position relative to another point in the 2 dimensional plane, for example   the position of which is defined as   relative to origin  

In the diagram point   and point   are the same point. It's just that the point has the name or definition   when referenced to origin   (black arrows), and   when referenced to origin   (red arrows).


By inspection:

  •   or  
  •   or  


Actual values:

 

 

    


Point   is defined as   relative to origin   and point   the same point, is defined as   relative to origin  

Examples

edit

Linear function

edit
 
Graph in 2 dimensions illustrating Translation of Coordinate Axes applied to linear function.
line1 can have 2 equations:
*   relative to origin  
*   relative to origin  

In the diagram line1 has equation  

What is equation of line1 relative to origin  


Using  

 

 

 


When   become   this means that equation   is relative to origin   line1 can have equation   or equation  


Equation   relative to origin   is same as equation   relative to origin  

Note that in both cases:

  •   intercept relative to origin is  
  •   intercept relative to origin is  

Rotation of Coordinate Axes

edit
 
Graph in 2 dimensions illustrating Rotation of Coordinate Axes.
Point   has 2 names or definitions:
  when defined relative to black arrows.
  when defined relative to red arrows.

If   axis, line  , is rotated through angle   so that   axis of new system becomes   then:

  • Counter-clockwise rotation occurs when   is positive.
  •   axis of new system becomes  
  • angle between   and   is  
  • angle between   and   is  


See diagram. By inspection:

Angle  

 

 

 

 

 

From  

From  


From   and  

 

 


Actual values:

Converting from   to  

# Python code.
>>> c,s = cosθ,sinθ = 4/5,3/5 ; c,s
(0.8, 0.6)
>>> x,y = 15,30
>>> x1 = x*c + y*s
>>> y1 = y*c - x*s
>>> x1,y1
(30.0, 15.0)

Process reversed:

# Python code.
>>> c,s = cosθ,sinθ = 4/5,-3/5 ; c,s
(0.8, -0.6)
>>> x,y = 30,15
>>> x1 = x*c + y*s
>>> y1 = y*c - x*s
>>> x1,y1
(15.0, 30.0)

Examples

edit

Linear function

edit
 
Graph in 2 dimensions illustrating Rotation of Coordinate Axes applied to linear function.
line1 has 2 equations:
*   relative to   (black system).
*   relative to   (red system).

Let a line have equation:  

Let  

After rotation, equation of line relative to   (red arrows) is:

           

where:   


In the diagram line1 has equation   and  


What is equation of line1 relative to   (red system)?

# python code.
>>> a,b,d = 6,17,-300
>>> c,s = cosθ,sinθ = 4/5,3/5 ; c,s
(0.8, 0.6)
>>> A = a*c + b*s ; A
15.0
>>> B = b*c - a*s ; B
10.0

Equation of line1 relative to   or  

  Triangles   are congruent.

Line1:   has same position in red system as line2:   in black system.

Quartic function

edit
 
Graph in 2 dimensions illustrating Rotation of Coordinate Axes applied to quartic function.
Position of black curve in red system is same as that of red curve in black system.

Let quartic function be defined as  

In diagram,   and   axes are rotated through angle   to produce new system of coordinates   (red system.)


  What is equation of   relative to red system?

 

After substituting appropriate values for   code supplied to application grapher is:

  (0.0325520833333333)  ((x(0.8) - y(0.6))^4) 
+ (-0.252604166666667)  ((x(0.8) - y(0.6))^3) 
+ (-0.307291666666667)  ((x(0.8) - y(0.6))^2) 
+            (2.84375)  ((x(0.8) - y(0.6))  )
+ (2.375)
- (x(0.6) + y(0.8)) = 0

Red curve in diagram has equation  

Ellipse

edit
 
Graph in 2 dimensions illustrating Rotation of Coordinate Axes applied to ellipse.

Equation of ellipse in diagram is:  

What is equation of   relative to minor and major axes (red system)?


The most general equation of second degree in   has form:  

Rotation of coordinate axes when applied to the general equation produces the primed equation:   where:

 

  

 

 

 

 

 

 


Choose values of   that make coefficient  

From coefficient   above:

 

 

Square both sides, substitute   for   expand, gather like terms and result is:

  where:

 

 

 

 

See also: Solving ellipse at origin.


From   above,   or  

  or  

 
Graph in 2 dimensions showing 2 ellipses, f'(x,y), where f'(x,y) is f(x,y) relative to its minor and major axes.
# python code.
values_of_cosθ_sinθ = (
    (0.6,-0.8),
    (0.6,0.8),
    (0.8,-0.6),
    (0.8,0.6),
)

a,b,c,d,e,f = 55,-24,48,0,0,-2496

for ns in values_of_cosθ_sinθ :
    n,s = ns
    B = b*n*n + (2*c-2*a)*n*s - b*s*s
    if (abs(B) < 1e-14) :
        print ('ns =',n,s)
        A = a*n*n + b*n*s + c*s*s
        C = c*n*n - b*n*s + a*s*s
        D = d*n + e*s
        E = e*n - d*s
        F = f
        print ('   ',A,0,C,D,E,F)
ns = 0.6 0.8
    39.0 0 64.0 0.0 0.0 -2496
ns = 0.8 -0.6
    64.0 0 39.0 0.0 0.0 -2496

When  

When  

In this context,   is not the derivative of  

Expression   means   relative to primed system   (red system.)