0% found this document useful (0 votes)
20 views

Game Programming For T.Y. Computer Science Students

This presentation contains the sine rule and cosine rule proof. Basics of mathematics for computer graphics like an introduction to Trigonometry, Compound Angles, and Perimeter relationships. All topics considered "Mathematics for Computer Graphics" 2nd edition book by John Vince as reference.

Uploaded by

Aarti
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Game Programming For T.Y. Computer Science Students

This presentation contains the sine rule and cosine rule proof. Basics of mathematics for computer graphics like an introduction to Trigonometry, Compound Angles, and Perimeter relationships. All topics considered "Mathematics for Computer Graphics" 2nd edition book by John Vince as reference.

Uploaded by

Aarti
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 57

GAME

PROGRAMMING
BY MRS AARTI PARDESHI
SYLLABUS

Unit I: Mathematics for Unit II: DirectX Pipeline and Unit III:
Computer Graphics, DirectX Programming: • Introduction to Rendering Engines:
Kickstart: • Introduction To DirectX 11: • Unity Engine: Multi-platform
• Cartesian Coordinate system: • Direct3D 11 Rendering Pipeline: publishing, VR + AR:
• Vectors: • Trigonometry: • Scripting:
• Transformations: • Interpolation: • XR: VR, AR, MR
• DirectX: • Curves:
• Analytic Geometry:
TEXT BOOK(S):
1)
MATHEMATICS FOR COMPUTER GRAPHICS, JOHN
VINCE, SPRINGER-VERLAG LONDON, 5TH EDITION
,2017

2) MATHEMATICS FOR 3D GAME PROGRAMMING


AND COMPUTER GRAPHIC, ERIC LENGYEL,
DELMAR CENGAGE LEARNING, DELMAR
CENGAGE LEARNING,2011

3) INTRODUCTION TO 3D GAME PROGRAMMING


• Computer graphics contains many areas of specialism, such as data visualisation, 2D
computer animation, film special effects, computer games and 3D computer animation.

What is mathematics?

1. By building a system for counting using numbers, we have an amazing tool for
composing mathematical systems that help us measure quantity, structure, space and
change. Such systems have been applied to topics such as fluid dynamics, optimisation,
statistics, cryptography, game theory probability theory, and many more.

2. The concept of number, and the visual representation of number reveals all sorts of
patterns, that give rise to number systems, algebra, trigonometry, geometry, analytic
geometry and calculus.

3. The universe does not need any of these mathematical ideas to run its machinery, but
they are useful to understand and describe its operation.
Greek symbols:

α alpha ν nu
β beta ξ xi
γ gamma oo
δ delta π pi
ε epsilon ρ rho
ζ zeta σ sigma
η eta τ tau
θ theta υ upsilon
ι iota φ phi
κ kappa χ chi
λ lambda ψ psi
μ mu ω omega
some upper-case symbols:

Γ Gamma Σ Sigma
Δ Delta Υ Upsilon
Θ Theta Φ Phi
Λ Lambda Ψ Psi
Ξ Xi Ω Omega
Π Pi
Trigonometry
The word ‘trigonometry’ divides into three parts: ‘tri’, ‘gon’, ‘metry’, which means the measurement of
three-sided polygons, i.e. triangles. It is an ancient subject and is used across all branches of mathematics.

Units of Angular Measurement

The measurement of angles is at the heart of trigonometry, and today two units of
angular measurement have survived into modern usage: degrees and radians.

Degree represents one complete rotation i.e

Each degree divides into 60 min, and each minute divides into 60 s.

The radian of angular measure does not depend upon any arbitrary constant – it is the angle created by a
circular arc whose length is equal to the circle’s radius.

And because the perimeter of a circle is 2πr, 2π radians correspond to one complete rotation. As 360◦
correspond to 2π radians, 1 radian equals 180◦ /π, which is approximately 57.3◦. The following relationships
between radians and degrees are
consider the history of the word sine.

The Hindu word ardhajya meaning


‘half-chord’ was abbreviated to jya or bow string
(‘chord’), which was translated by the Arabs into
jiba, and corrupted to jb. Other translators
converted this to jaib, meaning ‘cove’, ‘bulge’
or ‘bay’, which in Latin is sinus.

 In Indian astronomy, the study of trigonometric


functions flourished in the Gupta period,
especially due to Aryabhata (sixth century CE). 
Influential works from the 4th–5th century, known as the Siddhantas (of which there
were five, the most important of which is the Surya Siddhanta)

first defined the sine as the modern relationship between half an angle and half a chord,
while also defining the cosine, versine, and inverse sine.

Aryabhata (476–550 AD), collected and expanded upon the developments of the
Siddhantas in an important work called the Aryabhatiya.

The Siddhantas and the Aryabhatiya contain the earliest surviving tables of sine values
and versine (1 − cosine) values, in 3.75° intervals from 0° to 90°, to an accuracy of 4
decimal places.

They used the words jya for sine, kojya for cosine, utkrama-jya for versine, and otkram
jya for inverse sine. The words jya and kojya eventually became sine and cosine
respectively after a mistranslation described above.
The Trigonometric Ratios
sin cos tan
4.7 Compound Angles
The idea behind compound angles or double angle is to express sin, cos or tan of one angle
with two different angles. It is possible because sin, cos or tan are nothing but ratios of sides.

Ex. sin(70) , 70 can be expressed as 50 + 20 in algebra but

• sin(70) sin(50) + sin(20)


• sin(180) sin (90 +90) sin(90) + sin(90)
0 (1 + 1)
0 2
4.7 Compound Angles
Two sets of compound trigonometric relationships show how to add and subtract two
different angles and multiples of the same angle. The following are some of the most
common relationships:
Prove that
(a + b+ c) 𝒃𝟐 +𝒄 𝟐 − 𝒂𝟐
𝒄𝒐𝒔 𝑨=
𝟐 𝒃𝒄

√ √
𝟐 𝟐 𝟐
𝑨 𝟏−𝑪𝑶𝑺 𝑨 𝟐 𝒃𝒄 − 𝒃 − 𝒄 +𝒂
𝐬𝐢𝐧 = ¿  
𝟐 𝟐 𝟒 𝒃𝒄

√ √
𝟐
𝟐 (𝒃 ¿ ¿𝟐−𝟐𝒃𝒄+𝒄 )
𝟐 𝟐 𝟐
𝒃 +𝒄 − 𝒂
𝟏−
𝟐 𝒃𝒄 ¿ 𝒂−  ¿
¿
𝟐
𝟒𝒃𝒄

√ √
𝟐 𝟐
𝟐 𝒃𝒄 − 𝒃 − 𝒄 +𝒂
𝟐 𝟐 𝟐 𝒂 −(𝒃−𝒄)
𝟐 𝒃𝒄
¿  
¿ 𝟒 𝒃𝒄
𝟐
√ √𝟐 ( 𝑺− 𝒄 ) .𝟐(𝑺 − 𝒃) 
𝟐 𝟐
𝒂 −(𝒃−𝒄)
¿   ¿  
𝟒 𝒃𝒄 4 𝒃𝒄

¿
√(𝒂+ ( 𝒃−𝒄 ) )(𝒂− ( 𝒃−𝒄 ))  
4 𝒃𝒄
  ¿
√( 𝑺− 𝒄 ) (𝑺 −𝒃) 
𝒃𝒄
 

¿
√(𝒂+𝒃−𝒄 )(𝒂− 𝒃+𝒄) 
𝟒𝒃𝒄
  ¿
√( 𝑺− 𝒃 ) (𝑺 −𝒄) 
𝒃𝒄
 


sin ()
(𝟐𝑺 −𝒄 − 𝒄)(𝟐𝑺 −𝒃− 𝒃) 
¿  
4 𝒃𝒄
Prove that
(a + b+ c) 𝒃𝟐 +𝒄 𝟐 − 𝒂𝟐
𝒄𝒐𝒔 𝑨=
𝟐 𝒃𝒄

√ √
𝟐 𝟐 𝟐
𝑨 𝟏+𝑪𝑶𝑺 𝑨 𝟐 𝒃𝒄+𝒃 +𝒄 − 𝒂
𝒄𝒐𝒔 = ¿  
𝟐 𝟐 𝟒𝒃𝒄

√ √
𝟐 𝟐
𝟐
𝒃 + 𝒄 −𝒂
𝟐 𝟐
(𝒃 ¿ ¿𝟐+𝟐 𝒃𝒄+𝒄 )−𝒂
𝟏+
𝟐 𝒃𝒄 ¿  ¿
¿
𝟐
𝟒 𝒃𝒄


𝟐 𝟐


𝟐
𝟐 𝒃𝒄 +𝒃 +𝒄 − 𝒂
𝟐 𝟐 (𝒃+𝒄) − 𝒂
¿  
¿
𝟐 𝒃𝒄 𝟒 𝒃𝒄
𝟐
√ √
𝟐 𝟐
(𝒃+𝒄) − 𝒂 𝟒 𝑺(𝑺− 𝒂) 
¿   ¿  
𝟒 𝒃𝒄 𝟒𝒃𝒄

√ √
𝑺(𝑺 − 𝒂) 
𝟐 𝟐
(𝟐𝑺 − 𝒂) − 𝒂
¿   ¿  
𝟒𝒃𝒄 𝒃𝒄

¿
√(𝟐𝑺 − 𝒂+𝒂)(𝟐 𝑺− 𝒂− 𝒂) 
4 𝒃𝒄
  cos ()

¿
√( 𝟐 𝑺 ) 𝟐(𝑺− 𝒂)  
4𝒃𝒄
 
Right fingers Left fingers
sin (0) = = 0 4 3 2 cos (0) = = 1

sin (30) =
60 45 30
cos (30) =
5
sin (45) = = 90 cos (45) =
1
sin (60) = 0 cos (60) =

sin (90) = cos (90) = = 0


Right fingers Left fingers
sin (0) = = 0 4 3 2 cos (0) = = 1

sin (30) =
60 45 30
cos (30) =
5
sin (45) = = 90 cos (45) =
1
sin (60) = 0 cos (60) =

sin (90) = cos (90) = = 0

You might also like