mathcomesalive

But what about size?  How big is a function ?  Various possibilities, for example the maximum value, the average value , ... , But the only really useful one is the mean square average value, which for a function defined on an interval is the square root of the integral if the square of the function over the interval.  This looks simpler in symbols !

      For a function  f (x) over  0 < x < 1,   size2  =     f (x)f (x)dx      


Taking  2 - 3x  as an example,      (2 - 3x)(2 - 3x)dx  =      (4 -  2x + 9x2)dx  =   4x + 6x2 + 3x3             =   13


So the size of  2 - 3x  is  √13

Now you can check to see if  5 + x  is ‘bigger’ than  2 - 3x.

RMS, or root mean square, values are used in AC electric circuits to measure voltage and in statistics to measure standard deviation or spread of a set of numbers.  

The radius of gyration in dynamics is also a RMS value.

One of the simplest two dimensional ‘things’ is the plane of basic geometry.  A transformation of the points of the plane is a process which moves each point of the plane to another point of the plane.  For example, I move every point of the plane one unit (inch) to the left, or I rotate the whole plane about one point through an angle of 15 degrees, or I twist the plane about a certain point while the very distant points hardly move (the hurricane effect). Some transformations preserve areas, some preserve angles of intersection, but the simplest ones preserve straight lines.  That is, if we think of all the points on a straight line in the plane, and transform the points of the plane, then the transformed points of the line are still in a straight line afterwards.

It is easiest for further analysis to see the points of the plane as described by vectors.  Each point P of the plane is related to a fixed point of the plane by a line segment with a length, or size, and a direction, from the fixed point to the point P.  The fixed point is called the origin.

The study of vectors is not only to aid in the solution of problems in statics, dynamics, and of course, relative velocity(!), but also to provide a foundation for the study of Fourier series, linear transformations and abstract vector spaces.  

While developing the “Vectors Alive” program I realised that a more vector oriented approach to linear transformations would be a good thing, and this implied a more vector oriented approach to vectors, so that vectors would been as having a life separate from the x,y coordinate system.

So what follows is what I came up with.

2D linear transformations

#nongeo

The vector describing the point P will be denoted p, or p when written.

A vector can be multiplied by a number (referred to as a scalar), and just gets longer or shorter accordingly.

Two vectors can be added together to give a third vector using the triangle law of addition.  The second vector is moved (slid, translated) so that its start point is at the end point of the first vector.  The vector which runs from the start of the first to the end of the second is then the sum of the two vectors.

P

p

origin

Now if p is fixed and q is allowed to get longer or shorter, with no change in direction, then the sum of p and q, p + q, will always describe a point on the line of the moved q.

This then gives an equation for the line,   v = p + kq    where k is a scalar which says how much of q is being used, and v is the resulting point on the line.

We can now see that any point in the plane can be described by “some of p and some of q”, and this description is unique.  In symbols

    (any vector)  v = hp + kq      (where h is the “some of p” ...)

p

origin

q

p+q

q moved

Formally, h and k are the components of v in the p and q directions, and  hp + kq  is called a linear combination of the vectors p and q.

Returning to transformations, those which preserve linear combinations are called linear transformations.  In symbols let T be a linear transformation,  Then it sends p to T(p) and q to T(q), and the requirement is

                                                 T(hp + kq) = hT(p)  + kT(q)

In words this says “The transformation of a linear combination of two vectors is the same linear combination of the transformations of those two vectors”.  So, for example, the transformation of  3p is three times the transformation of p, and the transformation of p + q is the sum of the transformations of p and of q.

It is now obvious (?really?) that linear transformations preserve straight lines - look at the following -

                                                T(p + kq) = T(p) + kT(q)                       - and put it into words -

So what do these linear transformations do?

Firstly there is a zero vector, called 0, starting and ending at the origin, and it is always sent to itself: T(0) = 0.


Secondly we can see easily that there are two types of transformation fitting the requirements. One is rotation around the origin and the other is expansion or contraction in one or two directions.

origin

origin

Expansion by 2.5 times this way

before

after

There is a third type, the shear, in which the transformation has one fixed (unchanged) line, and all the lines crossing it at right angles are pushed over by the same angle.  It is not so easy to see what happens to all the other straight lines !  The lines parallel to the shear line appear to be unchanged, but are pushed along by the transformation.

We will see later that every linear transformation can be constructed as a sequence of these simple types -

 First, an expansion, second, a shear, and third, a rotation.

origin

before

after

The shear line

Specifying a linear transformation

Since every vector can be described as a linear combination of any two non-parallel vectors, and since a linear transformation preserves linear combinations, it is enough to know what a linear transformation does to any two non-parallel vectors - its effect on any vector is then determined.

This is a lot more useful if we introduce the unit vector.  To do this we must have a unit of length, a foot, a metre, a light year, whatever.  Then a unit vector is a vector whose length is one unit of length.  A second unit vector makes things even simpler, as any vector can then be expressed as a linear combination of  the two unit vectors.

As we are considering our vectors to describe points in a plane, and a plane has lines on it which, geometrically speaking, can be at right angles, we will  take our two unit vectors to be at right angles (it is the directions which are at right angles!).

If two lines in the plane are not parallel then there is an angle between them, and so with two vectors in the plane.  If the two lines (or vectors) are at right angles then the angle is 90 degrees, but this is just a measurement.  Far more use is the trigonometric fact that the cosine of 90 degrees is zero, and this can be used to determine if two vectors are at right angles or not.                                                 θαβ

Now that every vector has a measurable length, which is written | v | and every pair of vectors has an angle θ we define the dot product of two vectors p and q as  p.q = length of p x length of q x cos(θ), or

                                                             p.q = | p | | q | cos(θ)

This says, among other things, that if  p.q  is zero then  p and q  are at right angles (the posh word for this is orthogonal).

This formula may look strange, but if you look at the cosine rule from trigonometry it makes sense:  

c2 = a2 + b2 - 2abcos(θ) says that if the 2abcos(θ) term is zero then the sides a and b are at right angles.

Now we have two unit vectors, call them  i  and  j, and set them at right angles, so  i.j = 0.  Then if a vector  v  is written as  αi + βj  we have  v.i = α  and  v.j = β.  (This does require that the distributive law applies, which follows from the definition of the dot product).

Check the diagram and apply basic trigonometry.

origin

i

j

v = αi + βj

β

α

Now we can specify a linear transformation by its effect on the two unit vectors  i  and  j.   i  goes to  T( i )  and  j  goes to  T( j ), where  T( i )  and  T( j )  are described in terms of   i  and  j.  So we can write

                                           T( i ) = ai  +  bj      and     T( j ) =  ci  +  dj

         

This can be written in matrix form as  

 a   b

 c   d

T( i )

T( j )

i

j

=

Now we can take any vector  v  in terms of  i  and  j,  say  v  =  αi  +  βj ,  and the transformation of  v  will be

                                T( v )  =  T(αi  +  βj )  

                                           =   αT( i ) +  βT( j )  

                                           =   α(ai  +  bj  ) +  β( ci  +  dj )

                                            =   αai  +  αbj   +  βci  +  βdj

                                            =   (αa  +  βc)i   +  (αb  +  βd)j                                                  

So the vector  v  with components  α  and  β  is transformed into a vector with components  αa + βc  and  αb + βd

It should be clear now that the components of a vector in a ‘unit vectors at right angles’ system  are the same as the coordinates of the end point of the vector in a square grid coordinate system, where  i  points along the x-axis and j points along the y-axis.  

Thus  (α,β)  goes to  (α*,β*)  =  (αa + βc, αb + βd)  and the transformation can be written in matrix form as           

Notice that this  2 by 2  matrix is the transpose of the one specifying the transformation found earlier.

 a   c

 b   d

  α*

  β*

α

β

=

θαβ

The diagram is a screen capture from the “Vectors Alive” program showing the two unit vectors j and k and the transforms of the two unit vectors, j → i and k → h.  The vector chosen to be transformed is g and its transform is l.

In the program it is possible to move g around and see the effect on l.  It is also possible to have the unit vectors not lined up with the (invisible) axes.

And of course i and h can be altered to represent a different transformation.

There may be a position of g for which l is in the same direction.  This means that the common line of g and l is a fixed line for the transformation.

The videos below show  “Vectors Alive”  in action.

i

This video shows how the transformed vector l moves as the vector g is moved.

To start, click on the video start button.

This video shows how the transformed vector l moves as the vector g is rotated around the origin.  The “Track” process shows the path followed.

Conclusion so far.

Every linear transformation on a two dimensional space with specified unit vectors at right angles is uniquely described by a 2 x 2 matrix of scalars.

The basic transformations and their representations.

Rotation in vector form.  i → u and j → v.  All vectors keep the same length, so u and v are unit vectors, and  u.i = cos(θ), u.j = sin(θ).  These are the components of  u  so  u = i cos(θ) + j sin(θ).  

i

j

v

u

θαβ

θ

θ

 cos(θ)  sin(θ)

-sin(θ)  cos(θ)

 u

 v

=

i

j

Then the component matrix form for this is the transpose: It shows how the point (x,y) is transformed into (X,Y)

cos(θ)  -sin(θ)

 sin(θ)  cos(θ)

 X

 Y

=

x

y

Similarly  v = - i sin(θ) + j cos(θ) ,  and we can write the matrix form for this :


^

top

Algebra_is_OK

<

back

Math Comes Alive

Shear.  The simplest shear transformation is one in which the line of the first unit vector, i, is unchanged (not just the line, all the points on the line stay put).  The other points are pushed

in the direction of the i by an amount proportional to their j component.  This is a direct description in terms of the x,y coordinates, and so we have the x,y transformation matrix :

Decomposing a linear transformation into  expansion, followed by  shear, followed by   rotation.  This I will show for an example.  You can turn it into an algebraic procedure at your leisure !

Take the transformation represented by the component form matrix  T =

Let the expansion be  E, the shear  S, and the rotation  R

Then  T = RSE which can be written as                                                           where C = cos(θ) and S = sin(θ)  


Now if we apply the inverse of R to both sides of the equation we get  R-1T = SE , and  SE  is a transformation with at least one fixed line, as we have (hopefully) removed the rotation.  If you multiply out  SE  you will see that the fixed line is  the  i  line, with points of the form  (α,0). This requirement can be written as

 1    b

 0    1

 X

 Y

=

x

y

In equation form this is  X = x + by,  Y = y

In unit vector form  i → u, where u = i, and  j → v, where v = bi + j for some scalar value b

Expansion:  The simple expansion (which of course includes contraction) keeps the two unit vector directions unchanged, so that vectors in the unit vector directions are multiplied by scalars, one for each direction.  The vector form of this is then  i → u and j → v, with  u = ai  and v = dj, which in matrix form is

 a     0

 0     d

 u

 v

=

i

j

, and in x,y component matrix form :

 a    0

 0    d

 X

 Y

=

x

y

So in equation form we have  X = ax,  Y = dy.

Clearly, if  0 < a < 1  then we have a contraction in the i  direction, and if  a < 0  then we have a reversal.

2    4

3   -5

a    0

0    d

1    b

0    1

C   -S

S    C

 C   S

-S   C

2    4

3   -5

1

0

α

0

=

When this is multiplied out there will be two equations, and the one without  α  is  -2S + 3C = 0. Since  S  and  C  are sine and cosine, we can see that  s = 3/√13  and  C = 2/√13.

So  R-1 =                           and  R  =  


Now we can calculate  SE  as  R-1T, which is  


                                                                                         ----  R-1 ----      -- T --               ------- SE ------

The final step is to express the matrix on the right as  expansion  followed by  shear  



This immediately gives  a = 13  and  d = -22, and then  b = -7/d = 7/22.  


And so, eventually,  T =  




                                                                          ---rotation----     --shear--     ---expansion---   

Exercise: Write a piece of code to do this job in general.          

  1

√13

 2   3

-3   2

 2  -3

 3   2

  1

√13

  1

√13

 2   3

-3   2

2    4

3   -5

  1

√13

13  -7

0  -22

=

13  -7

0  -22

=

a    0

0    d

1    b

0    1

a   bd

0    d

=

2    4

3   -5

=

  1

√13

 2  -3

 3   2

  1

√13

1   7/22

0     1

13   0

0  -22

=

 2  -3

 3   2

1   7/22

0     1

√13      0

 0   -22/√13

  1

√13

Vectors at large.

Vectors do not only represent forces, velocities, positions on the plane etc.


Take the linear functions  a + bx defined on the interval  0 < x < 1, where  a  and  b  are scalars (numbers). They can be added, subtracted and multiplied by a scalar, which makes them vector quantities.  We can consider the  a  and the  b  as their components, and picture them on a plane grid.

Check with the picture that adding as functions matches adding as vectors.

The  x  direction

The ‘constant’ direction

2 + x

0

1

0

1

0

1

0

1

Now we have to consider the other feature of a vector, which is ‘direction’, and also ‘angle’, and also whether any meaning can be given to ‘at right angles to’.

In the geometrical examples angle is directly related to the dot product, and so we look for a suitable definition of dot product.

For a geometrical vector  a  the size of  a, or  |a|, is  √(a.a), so to make sure that this is the case with these ‘function’ vectors we define the dot product of  two functions  f  and  g  as


    f.g  =     fgdx ,  and if  f.g = 0 we say that the vectors are orthogonal (at right angles, from the Greek)


Now you can find the dot product of  2 + x  and  1 + 4x.  Calculate      (2 + x)(1 + 4x)dx


More interesting is finding a  function  g  orthogonal to a given function  f.

Suppose  f  is 1 + x,  then  g  can be written generally as  a + bx, and we want  f.g = 0.  In other words

0

1

0

1

0

1

(1 + x)(a + bx)dx  =  0, which when evaluated will tell us about the values of  a  and  b

Now  (1 + x)(a + bx) =  a + (a + b)x + bx2   so the value of the integral is  a + (a + b)/2 + b/3

Set this to zero and get  b = -3a/5, which gives  a - 3ax/5  as orthogonal to  1 + x

Any multiple of this is also orthogonal to  1 + x  so we can write this as  k(5 - 3x), where k is any scalar.

If you plot these two functions as the two vectors, (1,1) and (5,-3), on the original grid you may get a surprise!

The reason is that the dot product for geometrical vectors and the dot product for these function vectors are different, and ‘at right angles’ depends on the dot product used.

What is needed in the function vector system is an orthogonal pair of unit vectors,  i  and  j.

Let us take  1 + 0x  as  i  and as above find the  j.  Set  j  as  a + bx, proceed as above and then fix the  a  and  b  to get unit length for  j . (i  has unit length already, check it).

(1 + 0x)(a + bx) =  a + bx  so the value of the integral is  a + b/2.  Hence  b = -2a, and to make a unit vector we will take  a  as  1  initially., So  j  is  1 + x


Calculate the size of  j :      square root of     (1 + x)(1 + x)dx   =   (1 + 1 + 1/3)  =   (7/3)


So  j  is now   (1 + x)/√(7/3)  or approximately  0.65(1+x)  and has unit length.












0

1

The  0.65(1+x) direction

The 1 + 0x direction

2(1+0x)+0.65(1+x)    (= 2.65 + 0.65x)

3(1+0x)+2(0.65(1+x))    (= 4.3 + 0.3x)

Now that we have a pair of orthogonal unit vectors i  and  j we can construct a square grid in which i  and  j are at right angles, and each point of the plane corresponds to one of the linear functions expessed as a combination of the  i  and  j  functions.

j

i

This account of non geometric vectors is developed much further in the mathematical subjects of

a) Finite-dimensional Vector Spaces,

and b) Fourier Analysis and Fourier Series

^

top

Algebra_is_OK

^

top

Algebra_is_OK