Ch 5
4.  Find the volume of the parallelepiped formed by the three vectors:

                A = i-2j
                B = 2i+j
                C = i-2j+2k

    Finding this volume is a fairly routine procedure.  The formula I will
    use is V = A*(BxC).  The area of the parallelogram formed by the
    two vectors, B & C, is the absolute value of their cross product.
    Then, dotting that result with A, will give the total volume of the
    solid.  The calculations follow:

IDL> A=[1,-2,0]
IDL> B=[2,1,0] 
IDL> C=[1,-2,2]
   
IDL> area=C#B
IDL> vol=total(A*area)
IDL> print,area
           2          -4           4
           1          -2           2
           0           0           0
IDL> print,vol
      10.0000

    You may have noticed that the order on the cross product has been
    reversed.  This due to an unknown problem with the IDL program.

10.  Solve the following simultaneous equations using Cramer's rule:

                 x - y + z = 2
                x + 2y + z = 4
               2x + 3y - z = 1

    Cramer's rule allows us to calculate the of the variables by using
    the value of the matrix determinant.  However in this case, we will
    first form the constant matrix and then multiply that by the inverse
    of the matrix of coefficients.  The calulations follow:


IDL> a = [[1,-1,1],[1,2,1],[2,3,-1]]  (This is the matrix of coefficients)
IDL> print,a
       1      -1       1
       1       2       1
       2       3      -1

IDL> b = invert (a)                  (This is the inverse of matrix a)
IDL> print,b
     0.555556    -0.222222     0.333333
    -0.333333     0.333333      0.00000
     0.111111     0.555556    -0.333333

IDL> c = [2,4,1]                     (This is constants matrix)
IDL> print,c
       2       4       1

IDL> sol = c#b                 (This will give us the answers we want)
IDL> print,sol
     x = 0.555555
     y = 0.666667
     z = 2.11111


14.  Show that the following three vectors are linearly independent:
     
     a1 = (1,1,1)
     a2 = (-1,1,0)
     a3 = (2,0,1)

     Linear independence can be demonstrated by showing that the
     determinant of the matrix formed by the three vectors is equal
     to zero.  In general the method of cofactors could be used to 
     solve this problem.  However, with the IDL program it is a very
     easy matter.  The calculations follow:

IDL> A = [[1.,1.,1.], [-1.,1.,0.], [2.,0.,1.]]
IDL> print, A                                  
      1.00000      1.00000      1.00000
     -1.00000      1.00000      0.00000
      2.00000      0.00000      1.00000

IDL> detA = determ (A)
IDL> print, detA
       0
     
     So, as you can see the deteminant is equal to zero therefore the
     three vectors are linearly independent.

32.  Find the inverse of A.

	Once again the IDL program allows us to take the inverse directly.
	The calculations follow:

IDL> A = [[2,1,0], [1,1,1], [2,0,2]]
IDL> print,A
       2       1       0
       1       1       1
       2       0       2

IDL> b = invert (A)
IDL> print,b
     0.500000    -0.500000     0.250000
     -0.00000      1.00000    -0.500000
    -0.500000     0.500000     0.250000
	
  
41.  Determine whether the matrix is a proper or an improper
     transformation.

	A matrix transformation is proper if the determinant is equal
        to 1 and improper if the determinant is equal to -1.  Again we
	will use the IDL program to save ourselves some work.  IDL do
	your stuff:

IDL> A = [[-4./5.,0,-3./5.], [0.,1.,0.], [3./5.,0.,-4./5.]]
IDL> print,A
    -0.800000      0.00000    -0.600000
      0.00000      1.00000      0.00000
     0.600000      0.00000    -0.800000
IDL> detA = determ (A)
IDL> print,detA
      1.00000

	As you can see, the value of the determinant is equal to 1 and
 	this proves that the transformation is proper.