You are on page 1of 36

# Introduction to Vector

## Lecturer: Kor Sokchea

Master of IT Engineering
Royal University of Phnom Penh

Semester I

(RUPP)

## Scientific Experience Seminar

Semester I

1 / 36

Overview
Cartesian Coordinate Systems
Vectors
I

Vector Notations

## The Relationship between Points and Vectors

Negating a Vector

(RUPP)

Semester I

2 / 36

## Cartesian Coordinate Systems

2D Coordinate Spaces
Consist of a special location
called the origin
Exist two straight lines that pass
through the origin
Two axes are perpendicular to
each other

(RUPP)

Semester I

3 / 36

(RUPP)

Semester I

4 / 36

(RUPP)

Semester I

5 / 36

## Cartesian Coordinate Systems

3D Cartesian Space
Extend 2D into 3D by addin a
3rd axis
xy, xz, and yz planes

(RUPP)

Semester I

6 / 36

(RUPP)

Semester I

7 / 36

(RUPP)

Semester I

8 / 36

(RUPP)

Semester I

9 / 36

Vector

## Mathematical Definition of Vector

 Vectors are the formal mathematical entities we use to do 2D and 3D
math
 Mathematically, a vector is nothing more than an array of numbers
 The dimesion of a vector tells how many numbers the vector
contains
 Vectors may be of any positive dimension (1D, 2D, 3D, 4D)

(RUPP)

## Scientific Experience Seminar

Semester I

10 / 36

Vector

Vector Notations
 There are two ways to write vector:
 Column vector

x
y
z
 Row vector


x y z

(RUPP)

## Scientific Experience Seminar

Semester I

11 / 36

Vector

Vector Notations
 In math, integer indices are used to access the elements of vector

(RUPP)

Semester I

12 / 36

Vector

## Geometric Definition of Vector

 The branch of mathematics that deals primarily with vectors and
matrices is called linear algebra
 For 3D math, we are mostly concerned with the geometric
interpretations of vectors and vector operations
 Geometrically speaking, a vector is a directed line segment that has
magnitude and direction
 What is magnitude and direction?

(RUPP)

Semester I

13 / 36

Vector

## Geometric Definition of Vector

 The magnitude of a vector is the length of the vector
 A vector may have any nonnegative length
 direction of a vector describes which way the vector is pointing in
space
 Where is this vector?

(RUPP)

Semester I

14 / 36

Vector

## Geometric Definition of Vector

 Vectors do not have position, only magnitude and direction
 Sound Impossible?

(RUPP)

Semester I

15 / 36

Vector

## Geometric Definition of Vector

 Many quantities we deal with on a daily basis have magnitude and
direction

Vector Quantities
 Displacement Take three step forward
 Velocity I am traveling northeast at 50 mph

Scalar Quantities
 Distance
 Speed

(RUPP)

Semester I

16 / 36

Vector

(RUPP)

Semester I

17 / 36

Vector

## The Zero Vector

 There is a special vector, known as the zero vector for any given
vector dimension

## The Zero Vector Notation

0
0

0=
....
....
0
 The Zero vector consist of a magnitude of zero
 The Zero vector has no direction
 The Zero vector of a given dimesion is the additive identity for the
set of vectors of that dimension
Lecturer: Kor Sokchea

(RUPP)

Semester I

18 / 36

Vector

(RUPP)

## Scientific Experience Seminar

Semester I

19 / 36

Vector

Negating a Vector
 The negation operation can be applied to vectors

Defintion
Every vector v has an additive inverse -v of the same dimension
such that:
v + (v) = 0

(RUPP)

## Scientific Experience Seminar

Semester I

20 / 36

Vector

Negating a Vector
Official Linear Algebra Rules
 To negate a vector of any dimension, we simply negate each
component of the vector as folows:

a1
a1
a2 a2

. .

. = .

an1 an1
an

(RUPP)

an

Semester I

21 / 36

Vector

## Negating Vector: Geometric Interpretation

 Negating a vector results in a vector of the same magnitude but
opposite direction

(RUPP)

Semester I

22 / 36

Vector

## Vector Multiplication by a Scalar

Official Linear Algebra Rules

a1
a2

k
. =
.

an1
an

(RUPP)

ka1
a1
ka2
a2

.
.

. k = .

.
.

kan1
an1
kan
an

Semester I

23 / 36

Vector

## Vector Multiplication by a Scalar

Example: Multiplying a 3D Vector by scalar

x
x
kx
k y = y k = ky
z
z
kz

 
vx /k
1
=
v = vy /k
k
k
vz /k
v

(RUPP)

Semester I

24 / 36

Vector

## Vector Multiplication by a Scalar

 Geometrically, multiplying a vector by a scalar K has the effect of
scaling the length by a factor of k

(RUPP)

## Scientific Experience Seminar

Semester I

25 / 36

Vector

 Two vectors can be added if they are of the same dimension

a1
b1
a1
a2
a2 b2

. .

. + . =

. .

an1
an1 bn1
an
an
bn

(RUPP)

## Scientific Experience Seminar

+ b1
+ b2

+ bn2
+ bn

Semester I

26 / 36

Vector

Vector Subtraction
 Two vectors can be subtracted if they are of the same dimension

b1
a1
b1
a1
a2 b2
a2 b2

. .
. .

. . = . + . =

. .
. .

an1 bn1
an1 bn1
bn
an
an
bn

(RUPP)

a1 b1
a2 b2

an1 bn2
an bn

Semester I

27 / 36

Vector

(RUPP)

## Scientific Experience Seminar

Semester I

28 / 36

Vector

Example
add the vectors a = (8,13) and b = (26,7)
c=a+b
c = (8,13) + (26,7) = (8+26,13+7) = (34,20)

(RUPP)

Semester I

29 / 36

Vector

## Subtracting Vector Example

 Reversing the vector we want to subtract by adding negative value,

example
Subtract k = (6, 5) from v = (8, 3)
a=v+k
a = (8, 3) + (6, 5) = (8, 3) + (6,5) = (86,35) = (2,2)
Lecturer: Kor Sokchea

(RUPP)

Semester I

30 / 36

Vector

## Vector Magnitude (Length)

v
u n
q
uX
2
2
kvk = t
vi2 = v12 + v12 + ... + vn1
+ vn
i=1

Example

kvk =
kvk =

(RUPP)

q
vx2 + vy2

(f or2Dvectorv)

q
vx2 + vy2 + vz2

(f or3Dvectorv)

## Scientific Experience Seminar

Semester I

31 / 36

Vector

Unit Vector
A unit vectors or normalized vectors are a vector that has a
magnitude of one
Some vectors become shorter after normalization if their length was
greater than 1
Some vectors become longer after normalization if their length was
less than 1
v
v
=
kvk

(RUPP)

Semester I

32 / 36

Vector

## Vector Dot Product

Official Linear Algebra Rules

b1
a1
a2 b2

... ...

an1 bn1
bn
an

a.b=

n
X

ai bi

i=1

(RUPP)

Semester I

33 / 36

Vector

## Vector Cross Product

Official Linear Algebra Rules

x1
x2
y1 z2 z1 y2
y1 y2 = z1 x2 x1 z2
z1
z2
x1 y2 y1 x2

(RUPP)

## Scientific Experience Seminar

Semester I

34 / 36

Literature

Literature
1

Foley, J. D., Van Dam, A., Feiner, S.K., Hughes, J. F., &
Phillips R. L. (1996). Introduction to Computer Graphics.

## Eberly D. H. (2001). 3D game engine design, a practical approach

to real-time computer graphics. Academic Press, Morgan Kaufmann.

## Hughes, J. F., Van Dam, A., Foley, J. D., & Feiner, S. K.

(2013). Computer graphics: principles and practice. Pearson
Education.

(RUPP)

## Scientific Experience Seminar

Semester I

35 / 36

Literature

Literature
1

Dunn, F., & Parberry, I. (2011). 3D math primer for graphics and
game development. CRC Press.

I

(RUPP)

Semester I

36 / 36