Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If you consider gravity as a vector, the direction would be vertical and its magnitude or length would be the strength of gravity at a certain point. Since gravity is not constant, you would have to draw a new arrow or vector at each measuring point. The result is a so-called vector field.

 

2D vectors with different length and orientation.

 

The graphical illustration is useful to get an idea of what a vector is, but currently it does not seem to tell us very much about how to calculate with vectors. How can we perform operations with arrows? Well, the first thing is to tell you a few things about notations. RealFlow is a 3D program, so we have to introduce a third coordinate and instead of “vector”, we are just using letters. The letter is the variable in this case! Each 3D vector consists of X, Y and Z coordinates. These coordinates can be any positive or negative number, including zero. So a complete vector could be written as:

...

Each coordinate ax, ay, az is called a scalar. Vector calculations can be performed by either using the individual scalars or the vector’s magnitude (or length). There are some basic operations you should know.

Vector Addition

c = a + b

( cx, cy, c) = ( ax, ay, a)  + ( bx, by, b

...

In this case all a components are added individually with their b counterpart and the result is again a triplet of scalars, resulting in vector c.

Vector Subtraction 

c = a - b

( cx, cy, c) = ( ax, ay, a)  - ( bx, by, b)

...

This operation is the same as the previously discussed vector addition. Again, you receive a vector c consisting of three scalars.

Scalar Product or Dot Product

c = a * b

c = ( ax, ay, a) * ( bx, by, b)

...

m = sqrt( ax2 + ay2  + az)

Multiplication with a Scalar

c = a * s

( cx, cy, c) = ( ax, ay, a)  * s

...

In this case there is only a single value, a scalar, that is simply multiplied with each coordinate as factor. The scalar s can be any positive floating or integer number, including 0.

Cross Product

c = a x b

cx = ay * bz - az * by 

...

The term a x b is pronounced "a cross b". This operation is more complex and therefore split into three lines for the individual components of the resulting vector. The cross product is very common with physical formulas dealing with natural phenomena. Many forces, for example the Lorentz force in magnetic fields or vortex forces, are calculated with the cross product. 

Vector Division

The division of two vectors like c = a : b is actually not defined and therefore not possible by default. But you can divide a vector by a scalar, in just the same way you have seen before under “Multiplication with a Scalar”.

...