SlideShare une entreprise Scribd logo
1  sur  38
Beginning Direct3D Game Programming:
Mathematics 3
Vectors
jintaeks@gmail.com
Division of Digital Contents, DongSeo University.
March 2016
Vector
 Although more abstract definitions are possible, we usually
restrict ourselves to vectors defined by n-tuples of real
numbers, where n is typically 2, 3, or 4.
 An n-dimensional vector V can be written as
 V=(v1,v2,…,vn)
2
 Vector addition and scalar multiplication: a vector v (blue) is
added to another vector w (red, upper illustration).
Below, w is stretched by a factor of 2, yielding the sum v +
2w.
3
Vector space
 A vector space (also called a linear space) is a collection of
objects called vectors, which may be added together
and multiplied ("scaled") by numbers, called scalars in this
context. Scalars are often taken to be real numbers.
4
First example: arrows in the plane
 The first example of a vector space consists of arrows in a
fixed plane, starting at one fixed point. This is used in physics
to describe forces or velocities. Given any two such
arrows, v and w, the parallelogram spanned by these two
arrows contains one diagonal arrow that starts at the origin,
too. This new arrow is called the sum of the two arrows and is
denoted v + w.
5
Second example: ordered pairs of numbers
 A second key example of a vector space is provided by pairs
of real numbers x and y. (The order of the
components x and y is significant, so such a pair is also called
an ordered pair.)
 Such a pair is written as (x, y).
 The sum of two such pairs:
(x1, y1) + (x2, y2) = (x1 + x2, y1 + y2)
 The multiplication of a pair:
a(x, y) = (ax, ay).
6
Operations
7
Linear combination
 In mathematics, a linear combination is
an expression constructed from a set of terms by multiplying
each term by a constant and adding the results (e.g. a linear
combination of x and y would be any expression of the
form ax+ by, where a and b are constants).
8
Linear independence
 Linearly independent vectors in R3.
9
 Linearly dependent
vectors in a plane
in R3.
 In the theory of vector spaces the concept of linear
dependence and linear independence of the vectors in a
subset of the vector space is central to the definition
of dimension.
 A set of vectors is said to be linearly dependent if one of the
vectors in the set can be defined as a linear combination of
the other vectors. If no vector in the set can be written in this
way, then the vectors are said to be linearly independent.
10
Basis(linear algebra)
 A set of vectors in a vector space V is called a basis, or a set
of basis vectors, if the vectors are linearly independent and
every vector in the vector space is a linear combination of this
set.
11
• The same vector can be represented in two different
bases (purple and red arrows).
 A vector v in R2 (blue) expressed in terms of different bases:
using the standard basis of R2 v = xe1 + ye2 (black), and using
a different, non-orthogonal basis: v = f1 + f2 (red).
12
Practice: Write a KVector class.
class KVector {
public:
KVector(float x=0, float y=0, float z=0);
virtual ~KVector();
void Translate(float tx, float ty, float tz);
void Scale(float sx, float sy, float sz);
void RotateZ(float theta);
float m_x;
float m_y;
float m_z;
};//class KVector
13
 We assume the origin is located at the center of client area.
 Draw the x-axis with red line.
 Draw the y-axis with green line.
 Draw two vectors A(5,4), B(2,7) with black line.
 Draw A+B with blue line.
Length
 The magnitude of an n-dimensional vector V is a scalar
denoted by ||V|| and is given by the formula
 The magnitude of a vector is also sometimes called the norm
or the length of a vector. A vector having a magnitude of
exactly one is said to have unit length, or may simply be
called a unit vector.
 When V represents a three-dimensional point or direction,
above equation can be written as:
14
Unit vector
 The normalized vector of a non-zero vector u is the unit
vector in the direction of u, i.e.,
 Unit vectors may be used to represent the axes of a Cartesian
coordinate system. For instance, the unit vectors in the
direction of the x, y, and z axes of a three dimensional
Cartesian coordinate system are
15
Inner Product
 The dot product of two vectors, also known as the scalar
product or inner product, is one of the most heavily used
operations in 3D graphics because it supplies a measure of
the difference between the directions in which the two vectors
point.
𝑃 · 𝑄 = 𝑖=1
𝑛
𝑃𝑖 𝑄𝑖
 This definition states that the dot product of two vectors is
given by the sum of the products of each component. In
three dimensions, we have
P·Q=PxQx+PyQy+PzQz
16
 Given two n-dimensional vectors P and Q, the dot product P
⋅Q satisfies the equation
P·Q=||P|| ||Q||cos(α)
 where α is the planar angle between the lines connecting the
origin to the points represented by P and Q.
17
 The sign of the dot product tells us whether two vectors lie
on the same side or on opposite sides of a plane.
18
 The situation often arises in which we need to decompose a
vector P into components that are parallel and perpendicular
to another vector Q.
19
Practice: Extend the KVector class.
20
 Add Length() function.
 Add Normalize() function.
 Add Dot() function.
 Print the angle between A(5,4) and B(2,7).
class KVector {
public:
float Length() const;
void Normalize()
KVector Dot(const KVector3& rhs_) const;
};//class KVector
Matrix
 In mathematics, a matrix (plural matrices) is
a rectangular array of numbers, symbols, or expressions,
arranged in rows and columns. The dimensions of below
matrix are 2 × 3 (read "two by three"), because there are two
rows and three columns.
21
 Each element of a matrix is often denoted by a variable with
two subscripts. For instance, a2,1 represents the element at the
second row and first column of a matrix A.
22
Size
 The size of a matrix is defined by the number of rows and
columns that it contains. A matrix with m rows and n columns
is called an m × n matrix or m-by-n matrix,
while m and n are called its dimensions.
23
Notation
 Matrices are commonly written in box
brackets or parentheses:
 The (1,3) entry of the following matrix A is 5 (also
denoted a13, a1,3, A[1,3] or A1,3):
24
Basic operations
 There are a number of basic operations that can be applied to
modify matrices, called matrix addition, scalar
multiplication, transposition, matrix multiplication and row
operations.
25
Addition
 The sum A+B of two m-by-n matrices A and B is calculated
entrywise:
(A + B)i,j = Ai,j+ Bi,j, where 1 ≤ i ≤ m and 1 ≤ j ≤ n.
26
Transposition
 The transpose of an m-by-n matrix A is the n-by-m
matrix AT (also denoted Atr) formed by turning rows into
columns and vice versa:
(AT)i,j = Aj,i.
27
Scalar multiplication
 The product cA of a number c (also called a scalar in the
parlance of abstract algebra) and a matrix A is computed by
multiplying every entry of A by c:
(cA)i,j = c · Ai,j.
 This operation is called scalar multiplication, but its result is
not named “scalar product” to avoid confusion, since “scalar
product” is sometimes used as a synonym for “inner product”.
28
Determinant
 In linear algebra, the determinant is a useful value that can
be computed from the elements of a square matrix. The
determinant of a matrix A is denoted det(A), det A, or |A|.
29
Cross Product
 The cross product of two three-dimensional vectors, also
known as the vector product, returns a new vector that is
perpendicular to both of the vectors being multiplied
together.
30
• The cross-product in respect to a left-handed coordinate
system.
Cross Product
 Used in a method for calculating a surface normal at a
particular point given two distinct tangent vectors.
P×Q=(PyQz-PzQy, PzQx-PxQz, PxQy-PyQx)
31
• The cross-product in respect to a left-handed coordinate
system.
 A commonly used tool for remembering this formula is to
calculate cross products by evaluating the
pseudodeterminant.
 where i, j, and k are unit vectors parallel to the x, y, and z
axes:
i=(1,0,0)
j=(0,1,0)
k=(0,0,1)
32
Cross Product
P×Q=(PyQz-PzQy, PzQx-PxQz, PxQy-PyQx)
33
Geometrix meaning
 The magnitude of the cross product can be interpreted as the
positive area of the parallelogram having a and b as sides:
34
Algebraic properties
 If the cross product of two vectors is the zero vector
(i.e. a × b = 0), then either one or both of the inputs is the
zero vector, (a = 0 and/or b = 0) or else they are parallel or
antiparallel (a ∥ b) so that the sine of the angle between
them is zero (θ = 0° or θ = 180° and sinθ = 0).
 The self cross product of a vector is the zero vector,
i.e., a × a = 0.
 The cross product is anticommutative,
a×b=-(b×a)
 distributive over addition,
a×(b+c)=(a×b)+(a×c)
 and compatible with scalar multiplication so that
(ra)×b=a×(rb)=r(a×b)
35
Relation with dot product
 The cross product and the dot product are related by:
36
A rotating body
 In mathematics a rotating body is commonly represented by
a vector along the axis of rotation. The length of the vector
gives the speed of rotation and the direction of the axis gives
the direction of rotation according to the right-hand rule.
37
References
 https://en.wikipedia.org/wiki/Vector_space
38

Contenu connexe

Tendances

01.03 squared matrices_and_other_issues
01.03 squared matrices_and_other_issues01.03 squared matrices_and_other_issues
01.03 squared matrices_and_other_issuesAndres Mendez-Vazquez
 
Polynomials and Curve Fitting in MATLAB
Polynomials and Curve Fitting in MATLABPolynomials and Curve Fitting in MATLAB
Polynomials and Curve Fitting in MATLABShameer Ahmed Koya
 
Calculus and Numerical Method =_=
Calculus and Numerical Method =_=Calculus and Numerical Method =_=
Calculus and Numerical Method =_=Fazirah Zyra
 
Lines and planes in space
Lines and planes  in spaceLines and planes  in space
Lines and planes in spaceTarun Gehlot
 
Numerical Methods
Numerical MethodsNumerical Methods
Numerical MethodsESUG
 
vector application
vector applicationvector application
vector applicationrajat shukla
 
7.5 lines and_planes_in_space
7.5 lines and_planes_in_space7.5 lines and_planes_in_space
7.5 lines and_planes_in_spaceMahbub Alwathoni
 
Math lecture 10 (Introduction to Integration)
Math lecture 10 (Introduction to Integration)Math lecture 10 (Introduction to Integration)
Math lecture 10 (Introduction to Integration)Osama Zahid
 
Lecture 9 dim & rank - 4-5 & 4-6
Lecture 9   dim & rank -  4-5 & 4-6Lecture 9   dim & rank -  4-5 & 4-6
Lecture 9 dim & rank - 4-5 & 4-6njit-ronbrown
 
Computer Graphics & linear Algebra
Computer Graphics & linear Algebra Computer Graphics & linear Algebra
Computer Graphics & linear Algebra Xad Kuain
 
Clustering in Hilbert simplex geometry
Clustering in Hilbert simplex geometryClustering in Hilbert simplex geometry
Clustering in Hilbert simplex geometryFrank Nielsen
 
Matlab polynimials and curve fitting
Matlab polynimials and curve fittingMatlab polynimials and curve fitting
Matlab polynimials and curve fittingAmeen San
 
Lecture 7 determinants cramers spaces - section 3-2 3-3 and 4-1
Lecture 7   determinants cramers spaces - section 3-2 3-3 and 4-1Lecture 7   determinants cramers spaces - section 3-2 3-3 and 4-1
Lecture 7 determinants cramers spaces - section 3-2 3-3 and 4-1njit-ronbrown
 
Lecture 8 nul col bases dim & rank - section 4-2, 4-3, 4-5 & 4-6
Lecture 8   nul col bases dim & rank - section 4-2, 4-3, 4-5 & 4-6Lecture 8   nul col bases dim & rank - section 4-2, 4-3, 4-5 & 4-6
Lecture 8 nul col bases dim & rank - section 4-2, 4-3, 4-5 & 4-6njit-ronbrown
 

Tendances (20)

01.03 squared matrices_and_other_issues
01.03 squared matrices_and_other_issues01.03 squared matrices_and_other_issues
01.03 squared matrices_and_other_issues
 
Polynomials and Curve Fitting in MATLAB
Polynomials and Curve Fitting in MATLABPolynomials and Curve Fitting in MATLAB
Polynomials and Curve Fitting in MATLAB
 
Calculus and Numerical Method =_=
Calculus and Numerical Method =_=Calculus and Numerical Method =_=
Calculus and Numerical Method =_=
 
Lines and planes in space
Lines and planes  in spaceLines and planes  in space
Lines and planes in space
 
Differential calculus
Differential calculusDifferential calculus
Differential calculus
 
The integral
The integralThe integral
The integral
 
Numerical Methods
Numerical MethodsNumerical Methods
Numerical Methods
 
1525 equations of lines in space
1525 equations of lines in space1525 equations of lines in space
1525 equations of lines in space
 
vector application
vector applicationvector application
vector application
 
7.5 lines and_planes_in_space
7.5 lines and_planes_in_space7.5 lines and_planes_in_space
7.5 lines and_planes_in_space
 
Daa chapter11
Daa chapter11Daa chapter11
Daa chapter11
 
Math lecture 10 (Introduction to Integration)
Math lecture 10 (Introduction to Integration)Math lecture 10 (Introduction to Integration)
Math lecture 10 (Introduction to Integration)
 
Lecture 9 dim & rank - 4-5 & 4-6
Lecture 9   dim & rank -  4-5 & 4-6Lecture 9   dim & rank -  4-5 & 4-6
Lecture 9 dim & rank - 4-5 & 4-6
 
Computer Graphics & linear Algebra
Computer Graphics & linear Algebra Computer Graphics & linear Algebra
Computer Graphics & linear Algebra
 
Clustering in Hilbert simplex geometry
Clustering in Hilbert simplex geometryClustering in Hilbert simplex geometry
Clustering in Hilbert simplex geometry
 
Matlab polynimials and curve fitting
Matlab polynimials and curve fittingMatlab polynimials and curve fitting
Matlab polynimials and curve fitting
 
Lecture 7 determinants cramers spaces - section 3-2 3-3 and 4-1
Lecture 7   determinants cramers spaces - section 3-2 3-3 and 4-1Lecture 7   determinants cramers spaces - section 3-2 3-3 and 4-1
Lecture 7 determinants cramers spaces - section 3-2 3-3 and 4-1
 
01.01 vector spaces
01.01 vector spaces01.01 vector spaces
01.01 vector spaces
 
Lecture 8 nul col bases dim & rank - section 4-2, 4-3, 4-5 & 4-6
Lecture 8   nul col bases dim & rank - section 4-2, 4-3, 4-5 & 4-6Lecture 8   nul col bases dim & rank - section 4-2, 4-3, 4-5 & 4-6
Lecture 8 nul col bases dim & rank - section 4-2, 4-3, 4-5 & 4-6
 
Calculus I basic concepts
Calculus I basic conceptsCalculus I basic concepts
Calculus I basic concepts
 

En vedette

Beginning direct3d gameprogramming01_20161102_jintaeks
Beginning direct3d gameprogramming01_20161102_jintaeksBeginning direct3d gameprogramming01_20161102_jintaeks
Beginning direct3d gameprogramming01_20161102_jintaeksJinTaek Seo
 
Beginning direct3d gameprogrammingmath06_transformations_20161019_jintaeks
Beginning direct3d gameprogrammingmath06_transformations_20161019_jintaeksBeginning direct3d gameprogrammingmath06_transformations_20161019_jintaeks
Beginning direct3d gameprogrammingmath06_transformations_20161019_jintaeksJinTaek Seo
 
Beginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeks
Beginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeksBeginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeks
Beginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeksJinTaek Seo
 
Beginning direct3d gameprogramming03_programmingconventions_20160414_jintaeks
Beginning direct3d gameprogramming03_programmingconventions_20160414_jintaeksBeginning direct3d gameprogramming03_programmingconventions_20160414_jintaeks
Beginning direct3d gameprogramming03_programmingconventions_20160414_jintaeksJinTaek Seo
 
Beginning direct3d gameprogramming02_overviewofhalandcom_20160408_jintaeks
Beginning direct3d gameprogramming02_overviewofhalandcom_20160408_jintaeksBeginning direct3d gameprogramming02_overviewofhalandcom_20160408_jintaeks
Beginning direct3d gameprogramming02_overviewofhalandcom_20160408_jintaeksJinTaek Seo
 
Beginning direct3d gameprogramming05_thebasics_20160421_jintaeks
Beginning direct3d gameprogramming05_thebasics_20160421_jintaeksBeginning direct3d gameprogramming05_thebasics_20160421_jintaeks
Beginning direct3d gameprogramming05_thebasics_20160421_jintaeksJinTaek Seo
 
Beginning direct3d gameprogramming01_thehistoryofdirect3dgraphics_20160407_ji...
Beginning direct3d gameprogramming01_thehistoryofdirect3dgraphics_20160407_ji...Beginning direct3d gameprogramming01_thehistoryofdirect3dgraphics_20160407_ji...
Beginning direct3d gameprogramming01_thehistoryofdirect3dgraphics_20160407_ji...JinTaek Seo
 
Beginning direct3d gameprogramming04_3dfundamentals_20160414_jintaeks
Beginning direct3d gameprogramming04_3dfundamentals_20160414_jintaeksBeginning direct3d gameprogramming04_3dfundamentals_20160414_jintaeks
Beginning direct3d gameprogramming04_3dfundamentals_20160414_jintaeksJinTaek Seo
 
Beginning direct3d gameprogramming08_usingtextures_20160428_jintaeks
Beginning direct3d gameprogramming08_usingtextures_20160428_jintaeksBeginning direct3d gameprogramming08_usingtextures_20160428_jintaeks
Beginning direct3d gameprogramming08_usingtextures_20160428_jintaeksJinTaek Seo
 
Beginning direct3d gameprogramming07_lightsandmaterials_20161117_jintaeks
Beginning direct3d gameprogramming07_lightsandmaterials_20161117_jintaeksBeginning direct3d gameprogramming07_lightsandmaterials_20161117_jintaeks
Beginning direct3d gameprogramming07_lightsandmaterials_20161117_jintaeksJinTaek Seo
 
Beginning direct3d gameprogrammingmath02_logarithm_20160324_jintaeks
Beginning direct3d gameprogrammingmath02_logarithm_20160324_jintaeksBeginning direct3d gameprogrammingmath02_logarithm_20160324_jintaeks
Beginning direct3d gameprogrammingmath02_logarithm_20160324_jintaeksJinTaek Seo
 
Beginning direct3d gameprogrammingcpp02_20160324_jintaeks
Beginning direct3d gameprogrammingcpp02_20160324_jintaeksBeginning direct3d gameprogrammingcpp02_20160324_jintaeks
Beginning direct3d gameprogrammingcpp02_20160324_jintaeksJinTaek Seo
 
Beginning direct3d gameprogramming10_shaderdetail_20160506_jintaeks
Beginning direct3d gameprogramming10_shaderdetail_20160506_jintaeksBeginning direct3d gameprogramming10_shaderdetail_20160506_jintaeks
Beginning direct3d gameprogramming10_shaderdetail_20160506_jintaeksJinTaek Seo
 
Beginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeks
Beginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeksBeginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeks
Beginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeksJinTaek Seo
 
Beginning direct3d gameprogrammingmath05_matrices_20160515_jintaeks
Beginning direct3d gameprogrammingmath05_matrices_20160515_jintaeksBeginning direct3d gameprogrammingmath05_matrices_20160515_jintaeks
Beginning direct3d gameprogrammingmath05_matrices_20160515_jintaeksJinTaek Seo
 

En vedette (15)

Beginning direct3d gameprogramming01_20161102_jintaeks
Beginning direct3d gameprogramming01_20161102_jintaeksBeginning direct3d gameprogramming01_20161102_jintaeks
Beginning direct3d gameprogramming01_20161102_jintaeks
 
Beginning direct3d gameprogrammingmath06_transformations_20161019_jintaeks
Beginning direct3d gameprogrammingmath06_transformations_20161019_jintaeksBeginning direct3d gameprogrammingmath06_transformations_20161019_jintaeks
Beginning direct3d gameprogrammingmath06_transformations_20161019_jintaeks
 
Beginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeks
Beginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeksBeginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeks
Beginning direct3d gameprogramming06_firststepstoanimation_20161115_jintaeks
 
Beginning direct3d gameprogramming03_programmingconventions_20160414_jintaeks
Beginning direct3d gameprogramming03_programmingconventions_20160414_jintaeksBeginning direct3d gameprogramming03_programmingconventions_20160414_jintaeks
Beginning direct3d gameprogramming03_programmingconventions_20160414_jintaeks
 
Beginning direct3d gameprogramming02_overviewofhalandcom_20160408_jintaeks
Beginning direct3d gameprogramming02_overviewofhalandcom_20160408_jintaeksBeginning direct3d gameprogramming02_overviewofhalandcom_20160408_jintaeks
Beginning direct3d gameprogramming02_overviewofhalandcom_20160408_jintaeks
 
Beginning direct3d gameprogramming05_thebasics_20160421_jintaeks
Beginning direct3d gameprogramming05_thebasics_20160421_jintaeksBeginning direct3d gameprogramming05_thebasics_20160421_jintaeks
Beginning direct3d gameprogramming05_thebasics_20160421_jintaeks
 
Beginning direct3d gameprogramming01_thehistoryofdirect3dgraphics_20160407_ji...
Beginning direct3d gameprogramming01_thehistoryofdirect3dgraphics_20160407_ji...Beginning direct3d gameprogramming01_thehistoryofdirect3dgraphics_20160407_ji...
Beginning direct3d gameprogramming01_thehistoryofdirect3dgraphics_20160407_ji...
 
Beginning direct3d gameprogramming04_3dfundamentals_20160414_jintaeks
Beginning direct3d gameprogramming04_3dfundamentals_20160414_jintaeksBeginning direct3d gameprogramming04_3dfundamentals_20160414_jintaeks
Beginning direct3d gameprogramming04_3dfundamentals_20160414_jintaeks
 
Beginning direct3d gameprogramming08_usingtextures_20160428_jintaeks
Beginning direct3d gameprogramming08_usingtextures_20160428_jintaeksBeginning direct3d gameprogramming08_usingtextures_20160428_jintaeks
Beginning direct3d gameprogramming08_usingtextures_20160428_jintaeks
 
Beginning direct3d gameprogramming07_lightsandmaterials_20161117_jintaeks
Beginning direct3d gameprogramming07_lightsandmaterials_20161117_jintaeksBeginning direct3d gameprogramming07_lightsandmaterials_20161117_jintaeks
Beginning direct3d gameprogramming07_lightsandmaterials_20161117_jintaeks
 
Beginning direct3d gameprogrammingmath02_logarithm_20160324_jintaeks
Beginning direct3d gameprogrammingmath02_logarithm_20160324_jintaeksBeginning direct3d gameprogrammingmath02_logarithm_20160324_jintaeks
Beginning direct3d gameprogrammingmath02_logarithm_20160324_jintaeks
 
Beginning direct3d gameprogrammingcpp02_20160324_jintaeks
Beginning direct3d gameprogrammingcpp02_20160324_jintaeksBeginning direct3d gameprogrammingcpp02_20160324_jintaeks
Beginning direct3d gameprogrammingcpp02_20160324_jintaeks
 
Beginning direct3d gameprogramming10_shaderdetail_20160506_jintaeks
Beginning direct3d gameprogramming10_shaderdetail_20160506_jintaeksBeginning direct3d gameprogramming10_shaderdetail_20160506_jintaeks
Beginning direct3d gameprogramming10_shaderdetail_20160506_jintaeks
 
Beginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeks
Beginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeksBeginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeks
Beginning direct3d gameprogramming09_shaderprogramming_20160505_jintaeks
 
Beginning direct3d gameprogrammingmath05_matrices_20160515_jintaeks
Beginning direct3d gameprogrammingmath05_matrices_20160515_jintaeksBeginning direct3d gameprogrammingmath05_matrices_20160515_jintaeks
Beginning direct3d gameprogrammingmath05_matrices_20160515_jintaeks
 

Similaire à Beginning direct3d gameprogrammingmath03_vectors_20160328_jintaeks

Beginning direct3d gameprogrammingmath01_primer_20160324_jintaeks
Beginning direct3d gameprogrammingmath01_primer_20160324_jintaeksBeginning direct3d gameprogrammingmath01_primer_20160324_jintaeks
Beginning direct3d gameprogrammingmath01_primer_20160324_jintaeksJinTaek Seo
 
Vectorspace in 2,3and n space
Vectorspace in 2,3and n spaceVectorspace in 2,3and n space
Vectorspace in 2,3and n spaceAhmad Saifullah
 
Analytical Geometry in three dimension
Analytical Geometry in three dimensionAnalytical Geometry in three dimension
Analytical Geometry in three dimensionSwathiSundari
 
Chapter 12 Section 12.1 Three-Dimensional Coordinate Sys
Chapter 12 Section 12.1  Three-Dimensional Coordinate SysChapter 12 Section 12.1  Three-Dimensional Coordinate Sys
Chapter 12 Section 12.1 Three-Dimensional Coordinate SysEstelaJeffery653
 
Chapter 4: Vector Spaces - Part 1/Slides By Pearson
Chapter 4: Vector Spaces - Part 1/Slides By PearsonChapter 4: Vector Spaces - Part 1/Slides By Pearson
Chapter 4: Vector Spaces - Part 1/Slides By PearsonChaimae Baroudi
 
Lecture2 (vectors and tensors).pdf
Lecture2 (vectors and tensors).pdfLecture2 (vectors and tensors).pdf
Lecture2 (vectors and tensors).pdfentesarkareem1
 
Lecture 07 graphing linear equations
Lecture 07 graphing linear equationsLecture 07 graphing linear equations
Lecture 07 graphing linear equationsHazel Joy Chong
 
Linear_Algebra_final.pdf
Linear_Algebra_final.pdfLinear_Algebra_final.pdf
Linear_Algebra_final.pdfRohitAnand125
 
Lecture: Two-Way Kinematics
Lecture: Two-Way Kinematics Lecture: Two-Way Kinematics
Lecture: Two-Way Kinematics JasonMooney9
 
Computer graphics notes 2 tutorials duniya
Computer graphics notes 2   tutorials duniyaComputer graphics notes 2   tutorials duniya
Computer graphics notes 2 tutorials duniyaTutorialsDuniya.com
 

Similaire à Beginning direct3d gameprogrammingmath03_vectors_20160328_jintaeks (20)

2 vectors notes
2 vectors notes2 vectors notes
2 vectors notes
 
Beginning direct3d gameprogrammingmath01_primer_20160324_jintaeks
Beginning direct3d gameprogrammingmath01_primer_20160324_jintaeksBeginning direct3d gameprogrammingmath01_primer_20160324_jintaeks
Beginning direct3d gameprogrammingmath01_primer_20160324_jintaeks
 
Vectorspace in 2,3and n space
Vectorspace in 2,3and n spaceVectorspace in 2,3and n space
Vectorspace in 2,3and n space
 
Linear Algebra Assignment Help
Linear Algebra Assignment HelpLinear Algebra Assignment Help
Linear Algebra Assignment Help
 
Analytical Geometry in three dimension
Analytical Geometry in three dimensionAnalytical Geometry in three dimension
Analytical Geometry in three dimension
 
Chapter 12 Section 12.1 Three-Dimensional Coordinate Sys
Chapter 12 Section 12.1  Three-Dimensional Coordinate SysChapter 12 Section 12.1  Three-Dimensional Coordinate Sys
Chapter 12 Section 12.1 Three-Dimensional Coordinate Sys
 
Chapter 4: Vector Spaces - Part 1/Slides By Pearson
Chapter 4: Vector Spaces - Part 1/Slides By PearsonChapter 4: Vector Spaces - Part 1/Slides By Pearson
Chapter 4: Vector Spaces - Part 1/Slides By Pearson
 
Vector
VectorVector
Vector
 
Lecture2 (vectors and tensors).pdf
Lecture2 (vectors and tensors).pdfLecture2 (vectors and tensors).pdf
Lecture2 (vectors and tensors).pdf
 
Lecture 07 graphing linear equations
Lecture 07 graphing linear equationsLecture 07 graphing linear equations
Lecture 07 graphing linear equations
 
Linear_Algebra_final.pdf
Linear_Algebra_final.pdfLinear_Algebra_final.pdf
Linear_Algebra_final.pdf
 
Lecture: Two-Way Kinematics
Lecture: Two-Way Kinematics Lecture: Two-Way Kinematics
Lecture: Two-Way Kinematics
 
1533 game mathematics
1533 game mathematics1533 game mathematics
1533 game mathematics
 
Plano Numérico
Plano Numérico Plano Numérico
Plano Numérico
 
lec7.ppt
lec7.pptlec7.ppt
lec7.ppt
 
Vector space
Vector spaceVector space
Vector space
 
Computer Network Homework Help
Computer Network Homework HelpComputer Network Homework Help
Computer Network Homework Help
 
precalculus 6.3
precalculus 6.3precalculus 6.3
precalculus 6.3
 
Physics Presentation
Physics PresentationPhysics Presentation
Physics Presentation
 
Computer graphics notes 2 tutorials duniya
Computer graphics notes 2   tutorials duniyaComputer graphics notes 2   tutorials duniya
Computer graphics notes 2 tutorials duniya
 

Plus de JinTaek Seo

Neural network 20161210_jintaekseo
Neural network 20161210_jintaekseoNeural network 20161210_jintaekseo
Neural network 20161210_jintaekseoJinTaek Seo
 
05 heap 20161110_jintaeks
05 heap 20161110_jintaeks05 heap 20161110_jintaeks
05 heap 20161110_jintaeksJinTaek Seo
 
02 linked list_20160217_jintaekseo
02 linked list_20160217_jintaekseo02 linked list_20160217_jintaekseo
02 linked list_20160217_jintaekseoJinTaek Seo
 
Hermite spline english_20161201_jintaeks
Hermite spline english_20161201_jintaeksHermite spline english_20161201_jintaeks
Hermite spline english_20161201_jintaeksJinTaek Seo
 
01 stack 20160908_jintaek_seo
01 stack 20160908_jintaek_seo01 stack 20160908_jintaek_seo
01 stack 20160908_jintaek_seoJinTaek Seo
 
03 fsm how_toimplementai_state_20161006_jintaeks
03 fsm how_toimplementai_state_20161006_jintaeks03 fsm how_toimplementai_state_20161006_jintaeks
03 fsm how_toimplementai_state_20161006_jintaeksJinTaek Seo
 
Boost pp 20091102_서진택
Boost pp 20091102_서진택Boost pp 20091102_서진택
Boost pp 20091102_서진택JinTaek Seo
 
아직도가야할길 훈련 20090722_서진택
아직도가야할길 훈련 20090722_서진택아직도가야할길 훈련 20090722_서진택
아직도가야할길 훈련 20090722_서진택JinTaek Seo
 
3ds maxscript 튜토리얼_20151206_서진택
3ds maxscript 튜토리얼_20151206_서진택3ds maxscript 튜토리얼_20151206_서진택
3ds maxscript 튜토리얼_20151206_서진택JinTaek Seo
 
Multithread programming 20151206_서진택
Multithread programming 20151206_서진택Multithread programming 20151206_서진택
Multithread programming 20151206_서진택JinTaek Seo
 
03동물 로봇그리고사람 public_20151125_서진택
03동물 로봇그리고사람 public_20151125_서진택03동물 로봇그리고사람 public_20151125_서진택
03동물 로봇그리고사람 public_20151125_서진택JinTaek Seo
 
20150605 홀트입양예비부모모임 서진택
20150605 홀트입양예비부모모임 서진택20150605 홀트입양예비부모모임 서진택
20150605 홀트입양예비부모모임 서진택JinTaek Seo
 
Boost라이브러리의내부구조 20151111 서진택
Boost라이브러리의내부구조 20151111 서진택Boost라이브러리의내부구조 20151111 서진택
Boost라이브러리의내부구조 20151111 서진택JinTaek Seo
 

Plus de JinTaek Seo (13)

Neural network 20161210_jintaekseo
Neural network 20161210_jintaekseoNeural network 20161210_jintaekseo
Neural network 20161210_jintaekseo
 
05 heap 20161110_jintaeks
05 heap 20161110_jintaeks05 heap 20161110_jintaeks
05 heap 20161110_jintaeks
 
02 linked list_20160217_jintaekseo
02 linked list_20160217_jintaekseo02 linked list_20160217_jintaekseo
02 linked list_20160217_jintaekseo
 
Hermite spline english_20161201_jintaeks
Hermite spline english_20161201_jintaeksHermite spline english_20161201_jintaeks
Hermite spline english_20161201_jintaeks
 
01 stack 20160908_jintaek_seo
01 stack 20160908_jintaek_seo01 stack 20160908_jintaek_seo
01 stack 20160908_jintaek_seo
 
03 fsm how_toimplementai_state_20161006_jintaeks
03 fsm how_toimplementai_state_20161006_jintaeks03 fsm how_toimplementai_state_20161006_jintaeks
03 fsm how_toimplementai_state_20161006_jintaeks
 
Boost pp 20091102_서진택
Boost pp 20091102_서진택Boost pp 20091102_서진택
Boost pp 20091102_서진택
 
아직도가야할길 훈련 20090722_서진택
아직도가야할길 훈련 20090722_서진택아직도가야할길 훈련 20090722_서진택
아직도가야할길 훈련 20090722_서진택
 
3ds maxscript 튜토리얼_20151206_서진택
3ds maxscript 튜토리얼_20151206_서진택3ds maxscript 튜토리얼_20151206_서진택
3ds maxscript 튜토리얼_20151206_서진택
 
Multithread programming 20151206_서진택
Multithread programming 20151206_서진택Multithread programming 20151206_서진택
Multithread programming 20151206_서진택
 
03동물 로봇그리고사람 public_20151125_서진택
03동물 로봇그리고사람 public_20151125_서진택03동물 로봇그리고사람 public_20151125_서진택
03동물 로봇그리고사람 public_20151125_서진택
 
20150605 홀트입양예비부모모임 서진택
20150605 홀트입양예비부모모임 서진택20150605 홀트입양예비부모모임 서진택
20150605 홀트입양예비부모모임 서진택
 
Boost라이브러리의내부구조 20151111 서진택
Boost라이브러리의내부구조 20151111 서진택Boost라이브러리의내부구조 20151111 서진택
Boost라이브러리의내부구조 20151111 서진택
 

Dernier

UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGSIVASHANKAR N
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesPrabhanshu Chaturvedi
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 

Dernier (20)

UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 

Beginning direct3d gameprogrammingmath03_vectors_20160328_jintaeks

  • 1. Beginning Direct3D Game Programming: Mathematics 3 Vectors jintaeks@gmail.com Division of Digital Contents, DongSeo University. March 2016
  • 2. Vector  Although more abstract definitions are possible, we usually restrict ourselves to vectors defined by n-tuples of real numbers, where n is typically 2, 3, or 4.  An n-dimensional vector V can be written as  V=(v1,v2,…,vn) 2
  • 3.  Vector addition and scalar multiplication: a vector v (blue) is added to another vector w (red, upper illustration). Below, w is stretched by a factor of 2, yielding the sum v + 2w. 3
  • 4. Vector space  A vector space (also called a linear space) is a collection of objects called vectors, which may be added together and multiplied ("scaled") by numbers, called scalars in this context. Scalars are often taken to be real numbers. 4
  • 5. First example: arrows in the plane  The first example of a vector space consists of arrows in a fixed plane, starting at one fixed point. This is used in physics to describe forces or velocities. Given any two such arrows, v and w, the parallelogram spanned by these two arrows contains one diagonal arrow that starts at the origin, too. This new arrow is called the sum of the two arrows and is denoted v + w. 5
  • 6. Second example: ordered pairs of numbers  A second key example of a vector space is provided by pairs of real numbers x and y. (The order of the components x and y is significant, so such a pair is also called an ordered pair.)  Such a pair is written as (x, y).  The sum of two such pairs: (x1, y1) + (x2, y2) = (x1 + x2, y1 + y2)  The multiplication of a pair: a(x, y) = (ax, ay). 6
  • 8. Linear combination  In mathematics, a linear combination is an expression constructed from a set of terms by multiplying each term by a constant and adding the results (e.g. a linear combination of x and y would be any expression of the form ax+ by, where a and b are constants). 8
  • 9. Linear independence  Linearly independent vectors in R3. 9  Linearly dependent vectors in a plane in R3.
  • 10.  In the theory of vector spaces the concept of linear dependence and linear independence of the vectors in a subset of the vector space is central to the definition of dimension.  A set of vectors is said to be linearly dependent if one of the vectors in the set can be defined as a linear combination of the other vectors. If no vector in the set can be written in this way, then the vectors are said to be linearly independent. 10
  • 11. Basis(linear algebra)  A set of vectors in a vector space V is called a basis, or a set of basis vectors, if the vectors are linearly independent and every vector in the vector space is a linear combination of this set. 11 • The same vector can be represented in two different bases (purple and red arrows).
  • 12.  A vector v in R2 (blue) expressed in terms of different bases: using the standard basis of R2 v = xe1 + ye2 (black), and using a different, non-orthogonal basis: v = f1 + f2 (red). 12
  • 13. Practice: Write a KVector class. class KVector { public: KVector(float x=0, float y=0, float z=0); virtual ~KVector(); void Translate(float tx, float ty, float tz); void Scale(float sx, float sy, float sz); void RotateZ(float theta); float m_x; float m_y; float m_z; };//class KVector 13  We assume the origin is located at the center of client area.  Draw the x-axis with red line.  Draw the y-axis with green line.  Draw two vectors A(5,4), B(2,7) with black line.  Draw A+B with blue line.
  • 14. Length  The magnitude of an n-dimensional vector V is a scalar denoted by ||V|| and is given by the formula  The magnitude of a vector is also sometimes called the norm or the length of a vector. A vector having a magnitude of exactly one is said to have unit length, or may simply be called a unit vector.  When V represents a three-dimensional point or direction, above equation can be written as: 14
  • 15. Unit vector  The normalized vector of a non-zero vector u is the unit vector in the direction of u, i.e.,  Unit vectors may be used to represent the axes of a Cartesian coordinate system. For instance, the unit vectors in the direction of the x, y, and z axes of a three dimensional Cartesian coordinate system are 15
  • 16. Inner Product  The dot product of two vectors, also known as the scalar product or inner product, is one of the most heavily used operations in 3D graphics because it supplies a measure of the difference between the directions in which the two vectors point. 𝑃 · 𝑄 = 𝑖=1 𝑛 𝑃𝑖 𝑄𝑖  This definition states that the dot product of two vectors is given by the sum of the products of each component. In three dimensions, we have P·Q=PxQx+PyQy+PzQz 16
  • 17.  Given two n-dimensional vectors P and Q, the dot product P ⋅Q satisfies the equation P·Q=||P|| ||Q||cos(α)  where α is the planar angle between the lines connecting the origin to the points represented by P and Q. 17
  • 18.  The sign of the dot product tells us whether two vectors lie on the same side or on opposite sides of a plane. 18
  • 19.  The situation often arises in which we need to decompose a vector P into components that are parallel and perpendicular to another vector Q. 19
  • 20. Practice: Extend the KVector class. 20  Add Length() function.  Add Normalize() function.  Add Dot() function.  Print the angle between A(5,4) and B(2,7). class KVector { public: float Length() const; void Normalize() KVector Dot(const KVector3& rhs_) const; };//class KVector
  • 21. Matrix  In mathematics, a matrix (plural matrices) is a rectangular array of numbers, symbols, or expressions, arranged in rows and columns. The dimensions of below matrix are 2 × 3 (read "two by three"), because there are two rows and three columns. 21
  • 22.  Each element of a matrix is often denoted by a variable with two subscripts. For instance, a2,1 represents the element at the second row and first column of a matrix A. 22
  • 23. Size  The size of a matrix is defined by the number of rows and columns that it contains. A matrix with m rows and n columns is called an m × n matrix or m-by-n matrix, while m and n are called its dimensions. 23
  • 24. Notation  Matrices are commonly written in box brackets or parentheses:  The (1,3) entry of the following matrix A is 5 (also denoted a13, a1,3, A[1,3] or A1,3): 24
  • 25. Basic operations  There are a number of basic operations that can be applied to modify matrices, called matrix addition, scalar multiplication, transposition, matrix multiplication and row operations. 25
  • 26. Addition  The sum A+B of two m-by-n matrices A and B is calculated entrywise: (A + B)i,j = Ai,j+ Bi,j, where 1 ≤ i ≤ m and 1 ≤ j ≤ n. 26
  • 27. Transposition  The transpose of an m-by-n matrix A is the n-by-m matrix AT (also denoted Atr) formed by turning rows into columns and vice versa: (AT)i,j = Aj,i. 27
  • 28. Scalar multiplication  The product cA of a number c (also called a scalar in the parlance of abstract algebra) and a matrix A is computed by multiplying every entry of A by c: (cA)i,j = c · Ai,j.  This operation is called scalar multiplication, but its result is not named “scalar product” to avoid confusion, since “scalar product” is sometimes used as a synonym for “inner product”. 28
  • 29. Determinant  In linear algebra, the determinant is a useful value that can be computed from the elements of a square matrix. The determinant of a matrix A is denoted det(A), det A, or |A|. 29
  • 30. Cross Product  The cross product of two three-dimensional vectors, also known as the vector product, returns a new vector that is perpendicular to both of the vectors being multiplied together. 30 • The cross-product in respect to a left-handed coordinate system.
  • 31. Cross Product  Used in a method for calculating a surface normal at a particular point given two distinct tangent vectors. P×Q=(PyQz-PzQy, PzQx-PxQz, PxQy-PyQx) 31 • The cross-product in respect to a left-handed coordinate system.
  • 32.  A commonly used tool for remembering this formula is to calculate cross products by evaluating the pseudodeterminant.  where i, j, and k are unit vectors parallel to the x, y, and z axes: i=(1,0,0) j=(0,1,0) k=(0,0,1) 32
  • 34. Geometrix meaning  The magnitude of the cross product can be interpreted as the positive area of the parallelogram having a and b as sides: 34
  • 35. Algebraic properties  If the cross product of two vectors is the zero vector (i.e. a × b = 0), then either one or both of the inputs is the zero vector, (a = 0 and/or b = 0) or else they are parallel or antiparallel (a ∥ b) so that the sine of the angle between them is zero (θ = 0° or θ = 180° and sinθ = 0).  The self cross product of a vector is the zero vector, i.e., a × a = 0.  The cross product is anticommutative, a×b=-(b×a)  distributive over addition, a×(b+c)=(a×b)+(a×c)  and compatible with scalar multiplication so that (ra)×b=a×(rb)=r(a×b) 35
  • 36. Relation with dot product  The cross product and the dot product are related by: 36
  • 37. A rotating body  In mathematics a rotating body is commonly represented by a vector along the axis of rotation. The length of the vector gives the speed of rotation and the direction of the axis gives the direction of rotation according to the right-hand rule. 37