Transponing and multiplying matrixes

Determinants and algebraic complementations

Inverse matrixes and division of matrixes

Rotation of 3D-objects

Light emulation in 3D-scenes

Laplas, D' Alamber equations etc.

From vectors and matrixes to multidimensional functions,

from basis to Fourier analisis.

Adding and subtracting vectors and matrixes is simply adding and subtracting appropriate elements. Multiplying vectors has two modifications: vector multiplication, when we have vector as a result, and scalar multiplication, when we have number as a result. Scalar multiplication is strongly connected with the conception of basis in multidimensional space and the result of it is projection of one vector onto another. It is given by simple formulae:

Note the simple rule: when one index is repeated several times in the expression, it means sum of all elements with this index

Vector multiplication is a bit more complicated. The result of it is the vector, ortogonal to both initial vectors, and the length of resulting vector is proportional to the square of triangle, created by two initial vectors. It is given by formulae:,or , using conception of determinants:

Note that in 3-dimensional space vector multiplication involves 2 vectors, but in N-dimensional space it requires N-1 vectors of N dimensions, but scalar multiplication always requires only 2 vectors.

The most common form of linear dependence between vectors is:

It is called multiplication of vector and matrix. Such multiplication performs translating vector from one basis to another, and elements of the matrix is scalar multiplications of every vector of old basis on every vector of new basis:

Matrix is called Kroneker matrix, or single matrix. It's evident, that

*A _{i}E_{ij} = A_{j}*

If we want to translate one vector first to one basis, and then to the second basis, we must multiplicate initial vector twice by the matrixes of this translations. The result may be considered as a result of multiplication on one single matrix, which is multiplication of two initial matrixes. So the result of multiplication of two matrixes is the matrix of the same dimension, and is given by formulae:

or

The matrix *B _{ij} = A_{ji}* is called transponded matrix of

Here is the Delphi unit implementing basic operations on matrixes and vectors Matrix.pas.

In 3-dimensional space the square of triangle between two vectors is given by vector multiplication:

**S** = [**A**,**B**]

and the space of figure between three vectors is given by scalar multiplication of * S* on the third vector:

In N-dimensional case the "N-dimensional space" of the figure between N vectors is evaluated
as the determinant:

A definition of determinant is recurrent: determinant of N-dimensional matrix is
sum of mutiplications of i's elemnt of the first string on determinant of initial matrix without first string and i's column.

Here is some properties of determinant:

- Determinant is not changed while transponing the matrix
- Determinant changes its sign while swapping two rows or two columns of the matrix
- det(A*B) = det(A)*det(B)
- det(A
^{-1}) = det(A)^{-1} - When the basis given by matrix A is not full, det(A)=0

Let's try to find the matrix A^{-1} so that AA^{-1}=1
The matrix A^{-1} is given by formulae:

*A _{ij}^{-1} = S_{ij} /det(A)*
where

Here is the procedure evaluating determinant Determinant.pas and the Delphi unit implementing basic operations on matrixes and vectors Matrix.pas.

The most complicated areas of 3D-modelling is rotation of scenes and light emulation.

The rotations can be simply performed using polar system of coordinates. It's very simple to rotate objects in this coordinates, so rotating of the scene consists of several steps:

- Getting new basis in polar coordinates. Tree basic vectors must be ortogonal to each other and the length of each vector must be 1
- Translating each vector of this basis into decarte coordinates,using expressions:

*x = R*cos(v)*cos(h)*

*y = R*cos(v)*sin(h)*

*z = R*sin(v)*

where*v*and*h*is vertical angle of decline and horizontal angle of rotation. - Packing this three basic vectors into translation matrix.
- Multiplying vectors of all points of the scene by this matrix
- Redrawing scene

Emulating light is based on the dependance between intensivities of initial and reflected rays, given by formulae:

*I(a) = I _{0}*cos(a)*, or, using vectors

where

and

Every 3D-object which can be lighted consists of many plate polygons (let's consider them triangles for simplification). To built the lighted scene, we must evaluate the color of each polygon. Let's assume that we have the coordinates of all points of triangles of our surface. Then emulating light can be performed in several steps:

- Getting vectors of two sides of every triangle(see the picture below)
- Getting vector, normal to the surface of triangle by vector multiplying of this two vectors.
- The length of this vector is being made 1 - so we get single vector normal to the surface (
).**n** - By scalar multiplying
on the vector of light (it's direction is the direction of light ray and it's length is proportional to the intensivity of light) we get the intensivity of reflected light.**n**

RGB-components of color of our initial triangle is proportional to the intensivity of reflected light.

At first let's see some formulaes of differential operators in vector algebra:

(gradient) gives us the direction of fastest increase of function**grad**(divergence) is a thread of vector from very little area relative to it's space (for example, a thread of vector of velocity of liquid has very simple meaning)**div**(rotor) is a circulation of vector on a very small contour relative to it's square**rot**

*div(f***A**) = f*div(**A**) +**A***grad(f)*rot(f***A**) = f*rot(**A**) - [grad(f),**A**]*div([***A**,**B**]) =**B***rot(**A**) -**A***rot(**B**)*rot(grad(f)) = 0**div(rot(***A**)) = 0*grad(a*b) = a*grad(b) + b*grad(a)*

The most important equation is Laplas equation (or Puasson equation as more generalised type of equations). Laplas and Puasson equations is equations for such fields:

- field of electric potential
- field of temperature
- field of pressure
- field of "velocity potential" in hydrodynamics
- and many others, where
*div(grad(f))=g(x,y,z)*

Puasson equation is:

D'Alamber equation is:

D' Alamber equation is an equation for running waves and is very similar to Laplas equation. You can solve it both in complex Minkouski space and by approximating continual space by discrete dynamic elements, moving according to Newton's laws.

We can simply generalise all methods of matrix algebra onto functions.

So scalar multiplication of functions is:

"Multiplication of vector by matrix":

Basis function is ortogonal if

As you see now, Fourier analysis is only translating function as "vector" to another basis.
Now Fourier method is almost evident:

You can check whether the "basis function" * f(w,t) = e ^{iwt}* is ortogonal.

Сайт создан в системе uCoz