Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Tebbsy
18
Years of Service
User Offline
Joined: 7th Nov 2005
Location:
Posted: 8th Nov 2005 18:17
As promised heres my vectors tutorial. (Useful if you do A level maths and are doing Pure Core 4 )

Vectors - General information

NB: Vectors are normally in the form but for ease of typing i will write them like (a,b,c)

vectors are in the form (x,y,z) where x is the movement in the x axis, y is the movement in the y axis and z is the movement in the z axis. Pretty obvious really

There are two types of vectors, directional and positional vectors. Positional vectors are vectors that give the position of a point from the origin ie. (0,0,0) wheras directional vectors that give you the position of a point from another point.

Vectors - Addition

Adding vectors is useful if you want to create a single vectors from multiple vectors. All you do is add the relevant parts together.

e.g. (A,B,C) + (a,b,c) = (A+a,B+b,C+c)

for subtraction just change the + to a -.

Vectors - Creating a directional Vector from 2 positional vectors.

Consider the following positional vectors:

a = (2,3,4)
b = (10,-3,6)

You first have to think of these as directional vectors from (0,0,0). To create a directional vector you have to get to the origin and then to your destination point. This means you have to take the minus of one vector and add it to your destination point.

so a to b can be thought of as aThen all you do is work it out.

so -a + b = (-2+10,-3-3,-4+6) = (8,-6,2)

so your directional vector a to b is (8,-6,2)

Vectors - Multiplying

There are two ways of multiplying Vectors. One is the scaler product and the other considers the angle between the vectors. (see below)

The scaler product is found by multiplying the counterparts together.

eg. (a,b,c) x (A,B,C) = (a x A) + (b x B) + (c x C)

so (1,5,6) x (2,5,2) = (1 x 2) + (5 x 5) + (6 x 2) = 2 + 25 + 12 = 39

Vectors - Finding an angle between 2 directional vectors.

The general formula for finding the angle is:

a x b = |a| x |b| x Cos #

where a x b is the scaler product of a and b, |a| and |b| are the modulus (see below) of a and b and Cos # is the cosine of the angle.

The modulus of a vector is the "size" or magnitude of the vector. This is done by applying pythagoras' theorem.

e.g. |(x,y,z)| = square root of (x² + y² +z²)

so |(2,3,4)| = sqrt(4 + 9 + 16) = sqrt(29) = 5.385

Back to the angle equation.

Consider the following example:

a is the vector (3,2,-2)
b is the vector (1,4,-7)

axb = (3x1)+(2x4)+(-2x-7) = 3 + 8 + 14 = 25

|a| = sqrt(3² + 2² + (-2)²) = sqrt(9 + 4 + 4) = sqrt(17) = 4.123

|b| = sqrt(1² + 4² + (-7)²) = sqrt(1 + 16 + 49) = sqrt(56) = 7.483

Hence 25 = 4.123 x 7.483 x Cos #

25 = 30.8537Cos #

(25 / 30.8537) = Cos #

# = Inverse Cosine of (25 / 30.8537)

# = 35.9º

Ill write my mathematical matrices tutorial later
Tebbsy
18
Years of Service
User Offline
Joined: 7th Nov 2005
Location:
Posted: 8th Nov 2005 19:34
*Note error in Vectors - Creating a directional Vector from 2 positional vectors:

so a to b can be thought of as aThen all you do is work it out.

this should be:

so a to b can be thought of as -a+b. Then all you do is work it out.
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 8th Nov 2005 20:42
For the ppl that want to know:

A vector doesn't always have 3 dimensions. But it can also have 2 dimensions: (x,y), or even 4 dimensions: (x,y,z,w).

It can be possible that people find it hard to understand 4 dimensions, but it exists. All the rules are the same:

from
(x,y,z,w) x (X,Y,Z,W) = (x*X) + (y*Y) + (z*Z) + (w*W)

to

length = sqrt( x^2 + y^2 + z^2 + w^2 )

Immunity and Annihalation makes Immunihalation...
FROGGIE!
20
Years of Service
User Offline
Joined: 4th Oct 2003
Location: in front of my computer
Posted: 8th Nov 2005 20:59
I dont really get what the 4th dimension is for, assuming vectors are used for moving, could you please explain.
David T
Retired Moderator
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 8th Nov 2005 21:11
Time?

"A book. If u know something why cant u make a kool game or prog.
come on now. A book. I hate books. book is stupid. I know that I need codes but I dont know the codes"
Mnemonix
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: Skaro
Posted: 8th Nov 2005 21:19
Im a wanderer in the fourth dimension. Direct all your questions regarding this at me, at which point they will be promptly ignored.

WE SHALL BECOME ALL POWERFUL! CRUSH THE LESSER RACES! CONQUER THE GALAXY! UNIMAGINABLE POWER! UNLIMITED RICE PUDDING ! ! ! ETC. ! ! ! ETC.! ! !
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 9th Nov 2005 15:42
If we lived in a 2 dimensional world, we would never be able to imagine a 3 dimensional world either

Immunity and Annihalation makes Immunihalation...
Baggers
19
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 9th Nov 2005 16:14
Tebbsy: Sorry to stray from the point of your tutorial but for those interested in forth dimension shapes and vectors try checking out

http://en.wikipedia.org/wiki/4th_Dimension
http://en.wikipedia.org/wiki/Tesseract
http://mathworld.wolfram.com/Dimension.html

Peter H
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 10th Nov 2005 17:35
it's like a wrinkle in time or something

"We make the worst games in the universe."

Login to post a reply

Server time is: 2024-05-06 14:10:57
Your offset time is: 2024-05-06 14:10:57