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

6 Computer Graphics (CST307) - GT

This document discusses various geometric transformations used in computer graphics, including translation, rotation, scaling, and shearing. Translation moves an object by adding offsets to the x and y coordinates. Rotation rotates an object around a pivot point by applying a rotation formula to each point. Scaling enlarges or shrinks an object by multiplying points by scale factors. Shearing skews an object by adding weighted offsets to points based on their x or y values. Matrix representations provide a concise way to represent these transformations mathematically.

Uploaded by

Nand Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

6 Computer Graphics (CST307) - GT

This document discusses various geometric transformations used in computer graphics, including translation, rotation, scaling, and shearing. Translation moves an object by adding offsets to the x and y coordinates. Rotation rotates an object around a pivot point by applying a rotation formula to each point. Scaling enlarges or shrinks an object by multiplying points by scale factors. Shearing skews an object by adding weighted offsets to points based on their x or y values. Matrix representations provide a concise way to represent these transformations mathematically.

Uploaded by

Nand Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 103

Computer Graphics (CST307)

Lect: Modeling Transformation


What has been Covered so far
 Basics of a computer graphic system
 Idea about overall Graphic pipeline
 Object representation (Ist stage) - Partial
 Remaining will cover in the upcoming lecture
 Basic Output Primitives; Scan conversion
 Algorithms and working principle
Recap
Basic Idea
 Object representation techniques allow us to represent
objects individually
 Local/Object coordinates
 i.e., at the time of defining the objects, its shape, size, and
position is not important
 In order to create a scene, the objects needs to
assembled together in different setting.
 So called scene/world coordinate system
 When individual objects are assembled their size, shapes
and positions becomes very important
 We need to perform some operations to
 Transform objects from local to world coordinate
Modeling/geometric transformation (II stages)
Basic transformations
 Modeling transformation implies applying some
operations on the objects definition (in local coordinate)
to transform them as a component of the world
coordinate scene
 There are several such operations possible
 All these operations can be derived from a set of basic
operations:
 Translation (T),
 Rotation (R),
 Scaling (s),
 Shearing (s)
Basic operations
 Translation (T): Translation object from one position to
another
 Rotating (R): Rotates object by some angle in clockwise
or anticlockwise direction around an axis
 Scaling (S): Reduces/Increases Object size
 Shearing (Sh): Changes object shape
 Though not a basic transformation, can be derived from
rotation and scaling
 These operations changes geometric properties (Shape,
size and locations)
 Hence called geometric transformations
Translation
 Simplest of all
 To translate a point p(x, y) to a new location p’(x, y)
 Displace a point by tx and ty along the X and Y directions
 Positive displacement
 Negative displacement
 Same is true for vertical displacement
Translation
 Transformation that used to reposition
the object along the straight line path. (x',y')
 Adding translation distance 𝒕𝒙 and 𝒕𝒚
ty
to the original coordinate position (x,y)
(𝒙, 𝒚) respectively we move point at
new position (𝒙′ , 𝒚′ ). tx

 𝒙′ = 𝒙 + 𝒕𝒙 & 𝒚 ′ = 𝒚 + 𝒕𝒚
 Translation distance pair (𝒕𝒙, 𝒕𝒚 ) is
(x',y')
called a Translation Vector or Shift
Vector. ty
(x,y)
 It is rigid body transformation so we
need to translate whole object. tx
Rotation
 It is a transformation that used to reposition the object along
the circular path in the 𝑥𝑦 − 𝑝𝑙𝑎𝑛𝑒.
(x',y')
 To generate a rotation we specify a,
 Rotation angle 𝜽.
 Rotation Point (Pivot Point) (𝒙𝒓, 𝒚𝒓 ). (x,y)
θ

 +ve value of rotation angle defines counter clockwise


rotation.
 -ve value of rotation angle defines clockwise rotation.
Rotation Equation
 We first find the equation of rotation when pivot point is at
coordinate origin(0,0).
 From figure we can write.
(x',y')
𝒙 = 𝒓 𝐜𝐨𝐬 ∅
𝒚 = 𝒓 𝐬𝐢𝐧 ∅
(x,y)
θ


&
𝒙′ = 𝒓 𝐜𝐨𝐬 𝜽 + ∅ = 𝒓 𝐜𝐨𝐬 ∅ 𝐜𝐨𝐬 𝜽 − 𝒓 𝐬𝐢𝐧 ∅ 𝐬𝐢𝐧 𝜽
𝒚′ = 𝒓 𝐬𝐢𝐧(∅ + 𝜽) = 𝒓 𝐜𝐨𝐬 ∅ 𝐬𝐢𝐧 𝜽 + 𝒓 𝐬𝐢𝐧 ∅ 𝐜𝐨𝐬 𝜽
Contd.
 Now replace 𝒓 𝐜𝐨𝐬 ∅ with 𝒙 and 𝒓 𝐬𝐢𝐧 ∅ with 𝒚 in above
equation.
 𝒙′ = 𝒙 𝐜𝐨𝐬 𝜽 − 𝒚 𝐬𝐢𝐧 𝜽 (x',y')
 𝒚′ = 𝒙 𝐬𝐢𝐧 𝜽 + 𝒚 𝐜𝐨𝐬 𝜽
(x,y)
θ


Rotation about arbitrary point
 Transformation equation for rotation of a point about pivot
point (𝒙𝒓, 𝒚𝒓 ) is:
 𝒙′ = 𝒙𝒓 + (𝒙 − 𝒙𝒓 ) 𝐜𝐨𝐬 𝜽 − (𝒚 − 𝒚𝒓 ) 𝐬𝐢𝐧 𝜽
 𝒚′ = 𝒚𝒓 + 𝒙 − 𝒙𝒓 𝐬𝐢𝐧 𝜽 + (𝒚 − 𝒚𝒓 ) 𝐜𝐨𝐬 𝜽
 These equations are differing from rotation about origin and
its matrix representation is also different.
 Rotation is also rigid body
transformation so we need to (x',y')
rotate each point of object.
(x,y)
θ

(xr,yr)
How to apply
 For an object we simply apply all the points that makes
ups surface
 E.g., All vertices in a vertex list representation
 Control points for spline surface
 …..
 In this way, we can change object orientation by applying
rotation on the surface points
 Along with change in position with translation
Scaling
 Transformation that used to alter the size of an object is
known as scaling.
 This operation is carried out by multiplying coordinate value
(𝒙, 𝒚) with scale factors (𝒔𝒙 , 𝒔𝒚 ) respectively.
 Equation for scaling is given by,
𝒙′ = 𝒙 ∙ 𝒔𝒙 & 𝒚′ = 𝒚 ∙ 𝒔𝒚
Contd.
 Normal scaling will scale as well as reposition the object.
 Scale factors less than 1 reduce the size and move object
closer to origin.
 Scale factors greater than 1 enlarge the size of object and
move object away from origin

1 3
Contd.
 Same values of 𝒔𝒙 and 𝒔𝒚 will produce Uniform Scaling.
 Different values of 𝒔𝒙 and 𝒔𝒚 will produce Differential
(Non Uniform) Scaling.

Uniform Differential
Scaling Scaling
Fixed Point Scaling
 We can control the position of object after scaling by keeping
one position fixed called Fix point (𝒙𝒇 , 𝒚𝒇 ).

Fixed Point
Fixed Point Scaling Equation
 Equation for scaling with fixed point position as (𝒙𝒇 , 𝒚𝒇 ) is:
 𝒙′ = 𝒙𝒇 + (𝒙 − 𝒙𝒇 )𝒔𝒙 𝒚′ = 𝒚𝒇 + (𝒚 − 𝒚𝒇 )𝒔𝒚
 𝒙′ = 𝒙𝒇 + 𝒙𝒔𝒙 − 𝒙𝒇 𝒔𝒙 𝒚′ = 𝒚𝒇 + 𝒚𝒔𝒚 − 𝒚𝒇 𝒔𝒚
 𝒙′ = 𝒙𝒔𝒙 + 𝒙𝒇 (𝟏 − 𝒔𝒙 ) 𝒚′ = 𝒚𝒔𝒚 + 𝒚𝒇 (𝟏 − 𝒔𝒚 )
 Polygons are scaled by applying scaling at coordinates and
redrawing.
 Other body like circle and ellipse will scale using its defining
parameters.
 For example ellipse will scale using its semi major axis, semi
minor axis and center point scaling and redrawing at that
position.
Shearing
 With Shearing transformation, we change shape of an
object
Shearing
 General form of the transformation to determine the
new point (x’, y’) from the current point (x, y)
𝒙′ = 𝒙 + 𝒔𝒉𝒙 ∙ 𝒚
𝒚′ = 𝒚 + 𝒔𝒉𝒚 ∙ 𝒙
 𝒔𝒉𝒙 and 𝒔𝒉𝒚 are shearing factors along X and Y
coordinates
 Shearing may also reposition the objects like scaling
Note
 The equations shown in for basic transformations are not
very handy and convenient to use to build graphics
libraries/packages
Note
 The equations shown in for basic transformations are not
very handy and convenient to use to build graphics
libraries/packages
 Alternate representations are there
Basic equations of transformations
Matrix Representation of transformations
Translation
 We can represent it into single matrix equation in column
vector as;
Translation
 We can represent it into single matrix equation in column
vector as;
𝑷′ = 𝑷 + 𝑻
𝒙′ 𝒙 𝒕𝒙
= 𝒚 + 𝒕
𝒚′ 𝒚
Translation
 We can represent it into single matrix equation in column
vector as;
𝑷′ = 𝑷 + 𝑻
𝒙′ 𝒙 𝒕𝒙
= 𝒚 + 𝒕
𝒚′ 𝒚
 We can also represent it in row vector form as:
𝑷′ = 𝑷 + 𝑻
𝒙′ 𝒚′ = 𝒙 𝒚 + ,𝒕𝒙 𝒕𝒚 -
Translation
 We can represent it into single matrix equation in column
vector as;
𝑷′ = 𝑷 + 𝑻
𝒙′ 𝒙 𝒕𝒙
′ = 𝒚 + 𝒕
𝒚 𝒚
 We can also represent it in row vector form as:
𝑷′ = 𝑷 + 𝑻
𝒙′ 𝒚′ = 𝒙 𝒚 + ,𝒕𝒙 𝒕𝒚 -
 Since column vector representation is standard
mathematical notation and also many graphics package
like GKS and PHIGS uses column vector we will also
follow column vector representation.
Translation Example
 Example: - Translate the triangle [A (10, 10), B (15, 15),
C(20, 10)] 2 unit in 𝑥 direction and 1 unit in 𝑦 direction.
𝑡𝑥
We know that 𝑃′ =𝑃+𝑇 = 𝑃 + 𝑡
𝑦
Translation Example
 Example: - Translate the triangle [A (10, 10), B (15, 15),
C(20, 10)] 2 unit in 𝑥 direction and 1 unit in 𝑦 direction.
𝑡𝑥
We know that 𝑃′ =𝑃+𝑇 = 𝑃 + 𝑡
𝑦
10 2 12
For point (10, 10) 𝐴′ = + =
10 1 11
′ 15 2 17
For point (15, 15) 𝐵 = + =
15 1 16
20 2 22
For point (10, 10) 𝐶 ′ = + =
10 1 11
Translation Example
 Example: - Translate the triangle [A (10, 10), B (15, 15),
C(20, 10)] 2 unit in 𝑥 direction and 1 unit in 𝑦 direction.
𝑡𝑥
We know that 𝑃′=𝑃+𝑇 = 𝑃 + 𝑡
𝑦
10 2 12
For point (10, 10) 𝐴′ = + =
10 1 11
′ 15 2 17
For point (15, 15) 𝐵 = + =
15 1 16
20 2 22
For point (10, 10) 𝐶 ′ = + =
10 1 11
 Final coordinates after translation are:
[A’ (12, 11), B’ (17, 16), C’ (22, 11)]
Rotation: Matrix Representation
 𝒙′ = 𝒙 𝐜𝐨𝐬 𝜽 − 𝒚 𝐬𝐢𝐧 𝜽
 𝒚′ = 𝒙 𝐬𝐢𝐧 𝜽 + 𝒚 𝐜𝐨𝐬 𝜽 (x',y')

(x,y)
θ


Rotation: Matrix Representation
 𝒙′ = 𝒙 𝐜𝐨𝐬 𝜽 − 𝒚 𝐬𝐢𝐧 𝜽
 𝒚′ = 𝒙 𝐬𝐢𝐧 𝜽 + 𝒚 𝐜𝐨𝐬 𝜽 (x',y')

 column vector matrix equation are, (x,y)


 𝑷′ = 𝑹 ∙ 𝑷 θ


Rotation: Matrix Representation
 𝒙′ = 𝒙 𝐜𝐨𝐬 𝜽 − 𝒚 𝐬𝐢𝐧 𝜽
 𝒚′ = 𝒙 𝐬𝐢𝐧 𝜽 + 𝒚 𝐜𝐨𝐬 𝜽 (x',y')

 column vector matrix equation are, (x,y)


 𝑷′ = 𝑹 ∙ 𝑷 θ
𝒙′ 𝐜𝐨𝐬 𝜽 − 𝐬𝐢𝐧 𝜽 𝒙
 ′ = ∙ 𝒚 ∅
𝒚 𝐬𝐢𝐧 𝜽 𝐜𝐨𝐬 𝜽
Rotation Example
 Example: - Locate the new position of the triangle
[A (5, 4), B (8, 3), C (8, 8)] after its rotation by 90o clockwise
about the origin.
Rotation Example
 Example: - Locate the new position of the triangle
[A (5, 4), B (8, 3), C (8, 8)] after its rotation by 90o clockwise
about the origin.
 As rotation is clockwise we will take 𝜃 = −90° .
 𝑃′ = 𝑅 ∙ 𝑃
Rotation Example
 Example: - Locate the new position of the triangle
[A (5, 4), B (8, 3), C (8, 8)] after its rotation by 90o clockwise
about the origin.
 As rotation is clockwise we will take 𝜃 = −90° .
 𝑃′ = 𝑅 ∙ 𝑃
′ cos(−90) − sin(−90) 5 8 8
 𝑃 =
sin(−90) cos(−90) 4 3 8
Rotation Example
 Example: - Locate the new position of the triangle
[A (5, 4), B (8, 3), C (8, 8)] after its rotation by 90o clockwise
about the origin.
 As rotation is clockwise we will take 𝜃 = −90° .
 𝑃′ = 𝑅 ∙ 𝑃
′ cos(−90) − sin(−90) 5 8 8
 𝑃 =
sin(−90) cos(−90) 4 3 8
′ 0 1 5 8 8
 𝑃 =
−1 0 4 3 8
4 3 8
 𝑃′ =
−5 −8 −8
Rotation Example
 Example: - Locate the new position of the triangle
[A (5, 4), B (8, 3), C (8, 8)] after its rotation by 90o clockwise about
the origin.
 As rotation is clockwise we will take 𝜃 = −90° .
 𝑃′ = 𝑅 ∙ 𝑃
′ cos(−90) − sin(−90) 5 8 8
 𝑃 =
sin(−90) cos(−90) 4 3 8
0 1 5 8 8
 𝑃′ =
−1 0 4 3 8
′ 4 3 8
 𝑃 =
−5 −8 −8
 Final coordinates after rotation are: [A’ (4, -5), B’ (3, -8), C’ (8, -
8)]
Scaling: Matrix Representation
 Equation for scaling is given by,
𝒙′ = 𝒙 ∙ 𝒔𝒙 & 𝒚′ = 𝒚 ∙ 𝒔𝒚
Scaling: Matrix Representation
 Equation for scaling is given by,
𝒙′ = 𝒙 ∙ 𝒔𝒙 & 𝒚′ = 𝒚 ∙ 𝒔𝒚
 These equation can be represented in column vector matrix
equation as:
𝑷′ = 𝑺 ∙ 𝑷
𝒙′ 𝒔𝒙 𝟎 𝒙
= 𝟎 𝒔𝒚 ∙ 𝒚
𝒚′
 Any positive value can be assigned to(𝒔𝒙 , 𝒔𝒚 ).
Contd.
 Example scale square with opposite corner coordinate
point are (1, 1) and (2, 2) by scale factor (3, 3)
𝑷′ = 𝑺 ∙ 𝑷

1 3
Contd.
 Example scale square with opposite corner coordinate
point are (1, 1) and (2, 2) by scale factor (3, 3)
𝑷′ = 𝑺 ∙ 𝑷
𝑥1 ′ 𝑥2 ′ 3 0 1 2 3 6
= =
𝑦1 ′ 𝑦2 ′ 0 3 1 2 3 6

1 3
Scaling Example
 Example: - Consider square with left-bottom corner at
(2, 2) and right-top corner at (6, 6) apply the
transformation which makes its size half.
Scaling Example
 Example: - Consider square with left-bottom corner at
(2, 2) and right-top corner at (6, 6) apply the
transformation which makes its size half.
 As we want size half so value of scale factor are
𝑠𝑥 = 0.5, 𝑠𝑦 = 0.5 and Coordinates of square are [A (2,
2), B (6, 2), C (6, 6), D (2, 6)].
Scaling Example
 Example: - Consider square with left-bottom corner at (2, 2)
and right-top corner at (6, 6) apply the transformation which
makes its size half.
 As we want size half so value of scale factor are 𝑠𝑥 = 0.5, 𝑠𝑦 =
0.5 and Coordinates of square are [A (2, 2), B (6, 2), C (6, 6), D
(2, 6)].
 𝑃′ = 𝑆 ∙ 𝑃
′ 𝑠𝑥 0 2 6 6 2 0.5 0 2 6 6 2
 𝑃 = 0 𝑠 =
𝑦 2 2 6 6 0 0.5 2 2 6 6
Scaling Example
 Example: - Consider square with left-bottom corner at (2, 2)
and right-top corner at (6, 6) apply the transformation which
makes its size half.
 As we want size half so value of scale factor are 𝑠𝑥 = 0.5, 𝑠𝑦 =
0.5 and Coordinates of square are [A (2, 2), B (6, 2), C (6, 6), D
(2, 6)].
 𝑃′ = 𝑆 ∙ 𝑃
′ 𝑠𝑥 0 2 6 6 2 0.5 0 2 6 6 2
 𝑃 = 0 𝑠 =
𝑦 2 2 6 6 0 0.5 2 2 6 6
1 3 3 1
 𝑃′ =
1 1 3 3
 Final coordinate after scaling are:
[A’ (1, 1), B’ (3, 1), C’ (3, 3), D’ (1, 3)]
Problem
 We can follow the approach of 2x2 Matrix representation
for transformations: rotation , scaling and shearing but
not translation
Problem
 We can follow the approach of 2x2 Matrix representation
for transformations: rotation , scaling and shearing but
not translation
 In order to avoid to these situation we go for another
type of transformation known as homogenous coordinate
system
Contd.
 For efficient utilization we must calculate all sequence of
transformation in one step.
Contd.
 For efficient utilization we must calculate all sequence of
transformation in one step.
 For that reason we reformulate above equation to
eliminate the matrix addition associated with translation
terms in matrix 𝑴𝟐 .
Contd.
 For efficient utilization we must calculate all sequence of
transformation in one step.
 For that reason we reformulate above equation to
eliminate the matrix addition associated with translation
terms in matrix 𝑴𝟐 .
 We can combine that thing by expanding 2X2 matrix
representation into 3X3 matrices.
Contd.
 For efficient utilization we must calculate all sequence of
transformation in one step.
 For that reason we reformulate above equation to
eliminate the matrix addition associated with translation
terms in matrix 𝑴𝟐 .
 We can combine that thing by expanding 2X2 matrix
representation into 3X3 matrices.
 It will allows us to convert all transformation into matrix
multiplication.
Homogeneous Coordinate System
 We take recourse to one mathematical trick known as
the Homogeneous Coordinate System
Homogeneous Coordinate System
 We take recourse to one mathematical trick known as
the Homogeneous Coordinate System
 Homogeneous Coordinate System is an abstract
representation technique.
Homogeneous Coordinate System
 We take recourse to one mathematical trick known as
the Homogeneous Coordinate System
 Homogeneous Coordinate System is an abstract
representation technique.
 In this technique, a 2D point (x, y) is represented with 3-
element vector 𝒙𝒉 , 𝒚𝒉 , 𝒉 .
𝒙𝒉 𝒚𝒉
 Where 𝒙 = ,𝒚 = thus we can also write triple as
𝒉 𝒉
(𝒉 ∙ 𝒙, 𝒉 ∙ 𝒚, 𝒉).
Homogeneous Coordinate System
 We take recourse to one mathematical trick known as
the Homogeneous Coordinate System
 Homogeneous Coordinate System is an abstract
representation technique.
 In this technique, a 2D point (x, y) is represented with 3-
element vector 𝒙𝒉 , 𝒚𝒉 , 𝒉 .
𝒙𝒉 𝒚𝒉
 Where 𝒙 = ,𝒚 = thus we can also write triple as
𝒉 𝒉
(𝒉 ∙ 𝒙, 𝒉 ∙ 𝒚, 𝒉).
 𝒉 is called homogeneous factor – can take any non-zero
value.
Contd.
 Any point of the form 𝒙𝒉 , 𝒚𝒉 , 𝟎 is considered to be
infinity.
Contd.
 Any point of the form 𝒙𝒉 , 𝒚𝒉 , 𝟎 is considered to be
infinity.
 point (0, 0, 0) is not allowed
Homogeneous Matrix for Translation
 Let’s see each representation with 𝒉 = 𝟏
𝑷′ = 𝑻(𝒕𝒙 ,𝒕𝒚 ) ∙ 𝑷
𝒙′ 𝟏 𝟎 𝒕𝒙 𝒙
𝒚 ′ = 𝟎 𝟏 𝒕𝒚 𝒚
𝟏 𝟎 𝟎 𝟏 𝟏
Homogeneous Matrix for Translation
 Let’s see each representation with 𝒉 = 𝟏
𝑷′ = 𝑻(𝒕𝒙 ,𝒕𝒚 ) ∙ 𝑷
𝒙′ 𝟏 𝟎 𝒕𝒙 𝒙
𝒚 ′ = 𝟎 𝟏 𝒕𝒚 𝒚
𝟏 𝟎 𝟎 𝟏 𝟏
 Inverse of translation matrix is obtain by putting
− 𝒕𝒙 & − 𝒕𝒚 instead of 𝒕𝒙 & 𝒕𝒚 .
Homogeneous Matrix for Rotation
𝑷′ = 𝑹(𝜽) ∙ 𝑷
𝒙′ 𝐜𝐨𝐬 𝜽 − 𝐬𝐢𝐧 𝜽 𝟎 𝒙
𝒚′ = 𝐬𝐢𝐧 𝜽 𝐜𝐨𝐬 𝜽 𝟎 𝒚
𝟏 𝟎 𝟎 𝟏 𝟏
Homogeneous Matrix for Rotation
𝑷′ = 𝑹(𝜽) ∙ 𝑷
𝒙′ 𝐜𝐨𝐬 𝜽 − 𝐬𝐢𝐧 𝜽 𝟎 𝒙
𝒚′ = 𝐬𝐢𝐧 𝜽 𝐜𝐨𝐬 𝜽 𝟎 𝒚
𝟏 𝟎 𝟎 𝟏 𝟏
 Inverse of rotation matrix is obtained by replacing 𝜽
by −𝜽.
Homogeneous Matrix for Scaling
𝑷′ = 𝑺(𝒔𝒙 ,𝒔𝒚 ) ∙ 𝑷
𝒙′ 𝒔𝒙 𝟎 𝟎 𝒙
𝒚′ = 𝟎 𝒔𝒚 𝟎 𝒚
𝟏 𝟎 𝟎 𝟏 𝟏
Homogeneous Matrix for Scaling
𝑷′ = 𝑺(𝒔𝒙 ,𝒔𝒚 ) ∙ 𝑷
𝒙′ 𝒔𝒙 𝟎 𝟎 𝒙
𝒚′ = 𝟎 𝒔𝒚 𝟎 𝒚
𝟏 𝟎 𝟎 𝟏 𝟏
 Inverse of scaling matrix is obtained by replacing 𝒔𝒙 & 𝒔𝒚
𝟏 𝟏
by & respectively.
𝒔𝒙 𝒔𝒚
Homogeneous Matrix for Shearing
𝑷′ = 𝑺(𝒔𝒉𝒙 ,𝒔𝒉𝒚 ) ∙ 𝑷
𝒙′ 𝟏 𝒔𝒉𝒙 𝟎 𝒙
𝒚′ = 𝒔𝒉𝒚 𝟏 𝟎 𝒚
𝟏 𝟎 𝟎 𝟏 𝟏

Note: After getting p’ we get the new coordinates after dividing


p’ with h
Composite Transformation
 In practice we need to apply more than one
transformations to get desired result.
Composite Transformation
 In practice we need to apply more than one
transformations to get desired result.
 It is time consuming to apply transformation one by one
on each point of object.
Composite Transformation
 In practice we need to apply more than one
transformations to get desired result.
 It is time consuming to apply transformation one by one
on each point of object.
 So first we multiply all matrix of required transformations
which is known as composite transformation
matrix.
Composite Transformation
 In practice we need to apply more than one
transformations to get desired result.
 It is time consuming to apply transformation one by one
on each point of object.
 So first we multiply all matrix of required transformations
which is known as composite transformation
matrix.
 Than we use composite transformation matrix to
transform object.
 For column matrix representation, we form composite
transformations by multiplying matrices from right to left.
Multiple Translations
 Two successive translations are performed as:
 𝑷′ = 𝑻 𝒕𝒙𝟐 , 𝒕𝒚𝟐 ∙ *𝑻(𝒕𝒙𝟏 , 𝒕𝒚𝟏 ) ∙ 𝑷+
 𝑷′ = *𝑻 𝒕𝒙𝟐 , 𝒕𝒚𝟐 ∙ 𝑻(𝒕𝒙𝟏 , 𝒕𝒚𝟏 )+ ∙ 𝑷
Multiple Translations
 Two successive translations are performed as:
 𝑷′ = 𝑻 𝒕𝒙𝟐 , 𝒕𝒚𝟐 ∙ *𝑻(𝒕𝒙𝟏 , 𝒕𝒚𝟏 ) ∙ 𝑷+
 𝑷′ = *𝑻 𝒕𝒙𝟐 , 𝒕𝒚𝟐 ∙ 𝑻(𝒕𝒙𝟏 , 𝒕𝒚𝟏 )+ ∙ 𝑷
𝟏 𝟎 𝒕𝒙𝟐 𝟏 𝟎 𝒕𝒙𝟏
 𝑷′ = 𝟎 𝟏 𝒕𝒚𝟐 𝟎 𝟏 𝒕𝒚𝟏 ∙ 𝑷
𝟎 𝟎 𝟏 𝟎 𝟎 𝟏
Contd.
𝟏 𝟎 𝒕𝒙𝟐 𝟏 𝟎 𝒕𝒙𝟏
 𝑷′ = 𝟎 𝟏 𝒕𝒚𝟐 𝟎 𝟏 𝒕𝒚𝟏 ∙ 𝑷
𝟎 𝟎 𝟏 𝟎 𝟎 𝟏
𝟏 𝟎 𝒕𝒙𝟏 + 𝒕𝒙𝟐
 𝑷′ = 𝟎 𝟏 𝒕𝒚𝟏 + 𝒕𝒚𝟐 ∙ 𝑷
𝟎 𝟎 𝟏
 𝑷′ = 𝑻 𝒕𝒙𝟏 + 𝒕𝒙𝟐 , 𝒕𝒚𝟏 + 𝒕𝒚𝟐 ∙ 𝑷
Contd.
𝟏 𝟎 𝒕𝒙𝟐 𝟏 𝟎 𝒕𝒙𝟏
 𝑷′ = 𝟎 𝟏 𝒕𝒚𝟐 𝟎 𝟏 𝒕𝒚𝟏 ∙ 𝑷
𝟎 𝟎 𝟏 𝟎 𝟎 𝟏
𝟏 𝟎 𝒕𝒙𝟏 + 𝒕𝒙𝟐
 𝑷′ = 𝟎 𝟏 𝒕𝒚𝟏 + 𝒕𝒚𝟐 ∙ 𝑷
𝟎 𝟎 𝟏
 𝑷′ = 𝑻 𝒕𝒙𝟏 + 𝒕𝒙𝟐 , 𝒕𝒚𝟏 + 𝒕𝒚𝟐 ∙ 𝑷
 Here 𝑷′ and 𝑷 are column vector of final and initial point
coordinate respectively.
 This concept can be extended for any number of
successive translations.
Multiple Translations Example
 Example: Obtain the final coordinates after two
translations on point 𝑝(2,3) with translation vector
(4, 3) and (−1, 2) respectively.
 𝑃′ = 𝑇 𝑡𝑥1 + 𝑡𝑥2 , 𝑡𝑦1 + 𝑡𝑦2 ∙ 𝑃
1 0 𝑡𝑥1 + 𝑡𝑥2 1 0 4 + (−1) 2
 𝑃′ = 0 1 𝑡𝑦1 + 𝑡𝑦2 ∙ 𝑃 = 0 1 3+2 ∙ 3
0 0 1 0 0 1 1
1 0 3 2 5
 𝑃′ = 0 1 5 ∙ 3 = 8
0 0 1 1 1
 Final Coordinates after translations are 𝑝, (5, 8).
Multiple Rotations
 Two successive Rotations are performed as:
 𝑷′ = 𝑹(𝜽𝟐 ) ∙ *𝑹(𝜽𝟏 ) ∙ 𝑷+
 𝑷′ = *𝑹 𝜽𝟐 ∙ 𝑹 𝜽𝟏 + ∙ 𝑷
Multiple Rotations
 Two successive Rotations are performed as:
 𝑷′ = 𝑹(𝜽𝟐 ) ∙ *𝑹(𝜽𝟏 ) ∙ 𝑷+
 𝑷′ = *𝑹 𝜽𝟐 ∙ 𝑹 𝜽𝟏 + ∙ 𝑷
𝐜𝐨𝐬 𝜽𝟐 − 𝐬𝐢𝐧 𝜽𝟐 𝟎 𝐜𝐨𝐬 𝜽𝟏 −𝐬𝐢𝐧 𝜽𝟏 𝟎
 𝑷′ = 𝐬𝐢𝐧 𝜽𝟐 𝐜𝐨𝐬 𝜽𝟐 𝟎 𝐬𝐢𝐧 𝜽𝟏 𝐜𝐨𝐬 𝜽𝟏 𝟎 ∙ 𝑷
𝟎 𝟎 𝟏 𝟎 𝟎 𝟏

 𝑷 =
𝐜𝐨𝐬 𝜽𝟐 𝐜𝐨𝐬 𝜽𝟏 − 𝐬𝐢𝐧 𝜽𝟐 𝐬𝐢𝐧 𝜽𝟏 − 𝐬𝐢𝐧 𝜽𝟏 𝐜𝐨𝐬 𝜽𝟐 − 𝐬𝐢𝐧 𝜽𝟐 𝐜𝐨𝐬 𝜽𝟏 𝟎
𝐬𝐢𝐧 𝜽𝟏 𝐜𝐨𝐬 𝜽𝟐 + 𝐬𝐢𝐧 𝜽𝟐 𝐜𝐨𝐬 𝜽𝟏 𝐜𝐨𝐬 𝜽𝟐 𝐜𝐨𝐬 𝜽𝟏 − 𝐬𝐢𝐧 𝜽𝟐 𝐬𝐢𝐧 𝜽𝟏 𝟎 ∙p
𝟎 𝟎 𝟏
Multiple Rotations
 Two successive Rotations are performed as:
 𝑷′ = 𝑹(𝜽𝟐 ) ∙ *𝑹(𝜽𝟏 ) ∙ 𝑷+
 𝑷′ = *𝑹 𝜽𝟐 ∙ 𝑹 𝜽𝟏 + ∙ 𝑷
𝐜𝐨𝐬 𝜽𝟐 − 𝐬𝐢𝐧 𝜽𝟐 𝟎 𝐜𝐨𝐬 𝜽𝟏 −𝐬𝐢𝐧 𝜽𝟏 𝟎
 𝑷′ = 𝐬𝐢𝐧 𝜽𝟐 𝐜𝐨𝐬 𝜽𝟐 𝟎 𝐬𝐢𝐧 𝜽𝟏 𝐜𝐨𝐬 𝜽𝟏 𝟎 ∙ 𝑷
𝟎 𝟎 𝟏 𝟎 𝟎 𝟏
 𝑷′ =
𝐜𝐨𝐬 𝜽𝟐 𝐜𝐨𝐬 𝜽𝟏 − 𝐬𝐢𝐧 𝜽𝟐 𝐬𝐢𝐧 𝜽𝟏 − 𝐬𝐢𝐧 𝜽𝟏 𝐜𝐨𝐬 𝜽𝟐 − 𝐬𝐢𝐧 𝜽𝟐 𝐜𝐨𝐬 𝜽𝟏 𝟎
𝐬𝐢𝐧 𝜽𝟏 𝐜𝐨𝐬 𝜽𝟐 + 𝐬𝐢𝐧 𝜽𝟐 𝐜𝐨𝐬 𝜽𝟏 𝐜𝐨𝐬 𝜽𝟐 𝐜𝐨𝐬 𝜽𝟏 − 𝐬𝐢𝐧 𝜽𝟐 𝐬𝐢𝐧 𝜽𝟏 𝟎 ∙𝑷
𝟎 𝟎 𝟏
𝐜𝐨𝐬(𝜽𝟏 +𝜽𝟐 ) −𝐬𝐢𝐧(𝜽𝟏 +𝜽𝟐 ) 𝟎
 𝑷′ = 𝐬𝐢𝐧(𝜽𝟏 +𝜽𝟐 ) 𝐜𝐨𝐬(𝜽𝟏 +𝜽𝟐 ) 𝟎 ∙ 𝑷
𝟎 𝟎 𝟏
Contd.
𝐜𝐨𝐬(𝜽𝟏 +𝜽𝟐 ) −𝐬𝐢𝐧(𝜽𝟏 +𝜽𝟐 ) 𝟎
 𝑷′ = 𝐬𝐢𝐧(𝜽𝟏 +𝜽𝟐 ) 𝐜𝐨𝐬(𝜽𝟏 +𝜽𝟐 ) 𝟎 ∙ 𝑷
𝟎 𝟎 𝟏
 𝑷′ = 𝑹(𝜽𝟏 +𝜽𝟐 ) ∙ 𝑷
Contd.
𝐜𝐨𝐬(𝜽𝟏 +𝜽𝟐 ) −𝐬𝐢𝐧(𝜽𝟏 +𝜽𝟐 ) 𝟎
 𝑷′ = 𝐬𝐢𝐧(𝜽𝟏 +𝜽𝟐 ) 𝐜𝐨𝐬(𝜽𝟏 +𝜽𝟐 ) 𝟎 ∙ 𝑷
𝟎 𝟎 𝟏
 𝑷′ = 𝑹(𝜽𝟏 +𝜽𝟐 ) ∙ 𝑷
 Here 𝑷′ and 𝑷 are column vector of final and initial point
coordinate respectively.
 This concept can be extended for any number of
successive rotations.
Multiple Rotations Example
 Example: Obtain the final coordinates after two rotations on
point 𝑝(6,9) with rotation angles are 30𝑜 and 60𝑜 respectively.
 𝑃′ = 𝑅(𝜃1 +𝜃2 ) ∙ 𝑃
𝑐𝑜𝑠(𝜃1 +𝜃2 ) −𝑠𝑖𝑛(𝜃1 +𝜃2 ) 0
 𝑃′ = 𝑠𝑖𝑛(𝜃1 +𝜃2 ) 𝑐𝑜𝑠(𝜃1 +𝜃2 ) 0 ∙ 𝑃
0 0 1
𝑐𝑜𝑠(30 + 60) −𝑠𝑖𝑛(30 + 60) 0
 𝑃′ = 𝑠𝑖𝑛(30 + 60) 𝑐𝑜𝑠(30 + 60) 0 ∙ 𝑃
0 0 1
0 −1 0 6 −9
 𝑃′ = 1 0 0 ∙ 9 = 6
0 0 1 1 1
 Final Coordinates after rotations are 𝑝, (−9, 6).
Multiple Scaling
 Two successive scaling are performed as:
 𝑷′ = 𝑺 𝒔𝒙𝟐 , 𝒔𝒚𝟐 ∙ *𝑺(𝒔𝒙𝟏 , 𝒔𝒚𝟏 ) ∙ 𝑷+
 𝑷′ = *𝑺 𝒔𝒙𝟐 , 𝒔𝒚𝟐 ∙𝑺 𝒔𝒙𝟏 , 𝒔𝒚𝟏 + ∙ 𝑷
𝒔𝒙𝟐 𝟎 𝟎 𝒔𝒙𝟏 𝟎 𝟎
 𝑷′ = 𝟎 𝒔𝒚𝟐 𝟎 𝟎 𝒔𝒚𝟏 𝟎 ∙ 𝑷
𝟎 𝟎 𝟏 𝟎 𝟎 𝟏
𝒔𝒙𝟏 ∙ 𝒔𝒙𝟐 𝟎 𝟎
 𝑷′ = 𝟎 𝒔𝒚𝟏 ∙ 𝒔𝒚𝟐 𝟎 ∙ 𝑷
𝟎 𝟎 𝟏
Contd.
𝒔𝒙𝟏 ∙ 𝒔𝒙𝟐 𝟎 𝟎
 𝑷′ = 𝟎 𝒔𝒚𝟏 ∙ 𝒔𝒚𝟐 𝟎 ∙ 𝑷
𝟎 𝟎 𝟏
 𝑷′ = 𝑺 𝒔𝒙𝟏 ∙ 𝒔𝒙𝟐 , 𝒔𝒚𝟏 ∙ 𝒔𝒚𝟐 ∙ 𝑷
 Here 𝑷′ and 𝑷 are column vector of final and initial point
coordinate respectively.
 This concept can be extended for any number of
successive scaling.
Multiple Scaling Example
 Example: Obtain the final coordinates after two scaling
on line 𝑝𝑞 ,𝑝 2,2 , 𝑞(8, 8)- with scaling factors are
2, 2 and (3, 3) respectively.
 𝑃′ = 𝑆 𝑠𝑥1 ∙ 𝑠𝑥2 , 𝑠𝑦1 ∙ 𝑠𝑦2 ∙ 𝑃
𝑠𝑥1 ∙ 𝑠𝑥2 0 0 2∙3 0 0
 𝑃′ = 0 𝑠𝑦1 ∙ 𝑠𝑦2 0 ∙ 𝑃 = 0 2∙3 0 ∙𝑃
0 0 1 0 0 1
6 0 0 2 8 12 48
 𝑃′ = 0 6 0 ∙ 2 8 = 12 48
0 0 1 1 1 1 1
 Final Coordinates after rotations are 𝑝, (12, 12) and
𝑞 , 48, 48 .
Question
 Does the sequence of applying the transformation is
important?

Q2: Apart from having same matrix formulation, why


homogenous coordinate system is important?
Question
 Does the sequence of applying the transformation is
important?

Q2: Apart from having same matrix formulation, why


homogenous coordinate system is important?
Ans: https://prateekvjoshi.com/2014/06/13/the-concept-of-
homogeneous-
coordinates/#:~:text=Homogeneous%20coordinates%20are
%20used%20extensively,be%20implemented%20as%20matri
x%20operations.
General Pivot-Point Rotation
 For rotating object about arbitrary point called pivot point we
need to apply following sequence of transformation.
1. Translate the object so that the pivot-point coincides with the
coordinate origin.
2. Rotate the object about the coordinate origin with specified angle.
3. Translate the object so that the pivot-point is returned to its original
position (i.e. Inverse of step-1).
General Pivot-Point Rotation Equation
 Let’s find matrix equation for this
 𝑷′ = 𝑻 𝒙𝒓 , 𝒚𝒓 ∙ 𝑹 𝜽 ∙ 𝑻 −𝒙𝒓 , −𝒚𝒓 ∙ 𝑷
 𝑷′ = *𝑻 𝒙𝒓 , 𝒚𝒓 ∙ 𝑹 𝜽 ∙ 𝑻 −𝒙𝒓 , −𝒚𝒓 + ∙ 𝑷
𝟏 𝟎 𝒙𝒓 𝐜𝐨𝐬 𝜽 − 𝐬𝐢𝐧 𝜽 𝟎 𝟏 𝟎 −𝒙𝒓
 𝑷′ = 𝟎 𝟏 𝒚𝒓 𝐬𝐢𝐧 𝜽 𝐜𝐨𝐬 𝜽 𝟎 𝟎 𝟏 −𝒚𝒓 ∙
𝟎 𝟎 𝟏 𝟎 𝟎 𝟏 𝟎 𝟎 𝟏
𝑷
𝐜𝐨𝐬 𝜽 − 𝐬𝐢𝐧 𝜽 𝒙𝒓 (𝟏 − 𝐜𝐨𝐬 𝜽) + 𝒚𝒓 𝐬𝐢𝐧 𝜽
 𝑷′ = 𝐬𝐢𝐧 𝜽 𝐜𝐨𝐬 𝜽 𝒚𝒓 (𝟏 − 𝐜𝐨𝐬 𝜽) − 𝒙𝒓 𝐬𝐢𝐧 𝜽 ∙ 𝑷
𝟎 𝟎 𝟏
Contd.
𝐜𝐨𝐬 𝜽 − 𝐬𝐢𝐧 𝜽 𝒙𝒓 (𝟏 − 𝐜𝐨𝐬 𝜽) + 𝒚𝒓 𝐬𝐢𝐧 𝜽
 𝑷′ = 𝐬𝐢𝐧 𝜽 𝐜𝐨𝐬 𝜽 𝒚𝒓 (𝟏 − 𝐜𝐨𝐬 𝜽) − 𝒙𝒓 𝐬𝐢𝐧 𝜽 ∙ 𝑷
𝟎 𝟎 𝟏
 𝑷′ = 𝑹 𝒙𝒓 , 𝒚𝒓 , 𝜽 ∙ 𝑷
 Here 𝑷′ and 𝑷 are column vector of final and initial point
coordinate respectively and 𝒙𝒓 , 𝒚𝒓 are the coordinates
of pivot-point.
General Pivot-Point Rotation Example
 Example: - Locate the new position of the triangle ABC
[A (5, 4), B (8, 3), C (8, 8)] after its rotation by 90o clockwise
about the centroid.
 Pivot point is centroid of the triangle so:
5+8+8 4+3+8
 𝑥𝑟 = = 7 , 𝑦𝑟 = =5
3 3
 As rotation is clockwise we will take 𝜃 = −90° .
 𝑃′ = 𝑅(𝑥𝑟 , 𝑦𝑟 ,𝜃) ∙ 𝑃
 𝑃′ =
cos 𝜃 − sin 𝜃 𝑥𝑟 (1 − cos 𝜃) + 𝑦𝑟 sin 𝜃 5 8 8
sin 𝜃 cos 𝜃 𝑦𝑟 (1 − cos 𝜃) − 𝑥𝑟 sin 𝜃 4 3 8
0 0 1 1 1 1
Contd.
 𝑃′ =
cos(−90) − sin(−90) 7(1 − cos(−90)) + 5 sin(−90) 5 8 8
sin(−90) cos(−90) 5(1 − cos(−90)) − 7 sin(−90) 4 3 8
0 0 1 1 1 1
0 1 7(1 − 0) − 5(1) 5 8 8
 𝑃′ = −1 0 5(1 − 0) + 7(1) 4 3 8
0 0 1 1 1 1
0 1 2 5 8 8

𝑃 = −1
 0 12 4 3 8
0 0 1 1 1 1
Contd.
0 1 2 5 8 8
 𝑃′ = −1 0 12 4 3 8
0 0 1 1 1 1
6 5 10
 𝑃′ = 7 4 4
1 1 1
 Final coordinates after rotation are [A’ (6, 7), B’ (5, 4), C’
(10, 4)].
General Fixed-Point Scaling
 For scaling object with position of one point called fixed
point will remains same, we need to apply following sequence
of transformation.
1. Translate the object so that the fixed-point coincides with the
coordinate origin.
2. Scale the object with respect to the coordinate origin with
specified scale factors.
3. Translate the object so that the fixed-point is returned to its
original position (i.e. Inverse of step-1).
General Fixed-Point Scaling Equation
 Let’s find matrix equation for this
 𝑷′ = 𝑻 𝒙𝒇 , 𝒚𝒇 ∙ 𝑺 𝒔𝒙 , 𝒔𝒚 ∙ 𝑻 −𝒙𝒇 , −𝒚𝒇 ∙ 𝑷
 𝑷′ = *𝑻 𝒙𝒇 , 𝒚𝒇 ∙ 𝑺 𝒔𝒙 , 𝒔𝒚 ∙ 𝑻 −𝒙𝒇 , −𝒚𝒇 + ∙ 𝑷
𝟏 𝟎 𝒙𝒇 𝒔𝒙 𝟎 𝟎 𝟏 𝟎 −𝒙𝒇
 𝑷 ′ = 𝟎 𝟏 𝒚 𝒇 𝟎 𝒔𝒚 𝟎 𝟎 𝟏 −𝒚𝒇 ∙ 𝑷
𝟎 𝟎 𝟏 𝟎 𝟎 𝟏 𝟎 𝟎 𝟏
𝒔𝒙 𝟎 𝒙𝒇 (𝟏 − 𝒔𝒙 )
 𝑷′ = 𝟎 𝒔𝒚 𝒚𝒇 (𝟏 − 𝒔𝒚 ) ∙𝑷
𝟎 𝟎 𝟏
Contd.
𝒔𝒙 𝟎 𝒙𝒇 (𝟏 − 𝒔𝒙 )
 𝑷′ = 𝟎 𝒔𝒚 𝒚𝒇 (𝟏 − 𝒔𝒚 ) ∙ 𝑷
𝟎 𝟎 𝟏
 𝑷′ = 𝑺 𝒙𝒇 , 𝒚𝒇 , 𝒔𝒙 , 𝒔𝒚 ∙ 𝑷
 Here 𝑷′ and 𝑷 are column vector of final and initial point
coordinate respectively and 𝒙𝒇 , 𝒚𝒇 are the coordinates
of fixed-point.
General Fixed-Point Scaling Example
 Example: - Consider square with left-bottom corner at
(2, 2) and right-top corner at (6, 6) apply the
transformation which makes its size half such that its
center remains same.
 Fixed point is center of square so:
6+2 6+2
 𝑥𝑓 = , 𝑦𝑓 =
2 2
 As we want size half so value of scale factor are
𝑠𝑥 = 0.5, 𝑠𝑦 = 0.5 and Coordinates of square are [A (2,
2), B (6, 2), C (6, 6), D (2, 6)].
 𝑃′ = 𝑆 𝑥𝑓 , 𝑦𝑓 , 𝑠𝑥 , 𝑠𝑦 ∙ 𝑃
Contd.
 𝑃′ = 𝑆 𝑥𝑓 , 𝑦𝑓 , 𝑠𝑥 , 𝑠𝑦 ∙ 𝑃
𝑠𝑥 0 𝑥𝑓 (1 − 𝑠𝑥 ) 2 6 6 2
 𝑃′ = 0 𝑠𝑦 𝑦𝑓 (1 − 𝑠𝑦 ) 2 2 6 6
0 0 1 1 1 1 1
0.5 0 4(1 − 0.5) 2 6 6 2
 𝑃′ = 0 0.5 4(1 − 0.5) 2 2 6 6
0 0 1 1 1 1 1
0.5 0 2 2 6 6 2
 𝑃′ = 0 0.5 2 2 2 6 6
0 0 1 1 1 1 1
Contd.
0.5 0 2 2 6 6 2
 𝑃′ = 0 0.5 2 2 2 6 6
0 0 1 1 1 1 1
3 5 5 3
 𝑃′ = 3 3 5 5
1 1 1 1
 Final coordinate after scaling are:
[A’ (3, 3), B’ (5, 3), C’ (5, 5), D’ (3, 5)]
General Scaling Directions
 Parameter 𝒔𝒙 and 𝒔𝒚 scale the object along 𝒙 and 𝒚
directions.
 We can scale an object in other directions also.
 By rotating the object to align the desired scaling
directions with the coordinate axes before applying the
scaling transformation.
Contd.
 Suppose we apply scaling factor 𝒔𝟏 and 𝒔𝟐 in direction shown
in figure than we will apply following transformations.
1. Perform a rotation so that the direction for 𝒔𝟏 and 𝒔𝟐 coincide
with 𝒙 and 𝒚 axes.
2. Scale the object with specified scale factors.
3. Perform opposite rotation to return points to their original
orientations. (i.e. Inverse of step-1).
General Scaling Directions Equation
 Let’s find matrix equation for this
 𝑷′ = 𝑹−𝟏 𝜽 ∙ 𝑺 𝒔𝟏 , 𝒔𝟐 ∙ 𝑹 𝜽 ∙ 𝑷
 𝑷′ = *𝑹−𝟏 𝜽 ∙ 𝑺 𝒔𝟏 , 𝒔𝟐 ∙ 𝑹 𝜽 + ∙ 𝑷
𝐜𝐨𝐬 𝜽 𝐬𝐢𝐧 𝜽 𝟎 𝒔𝒙 𝟎 𝟎 𝐜𝐨𝐬 𝜽 − 𝐬𝐢𝐧 𝜽 𝟎
 𝑷′ = − 𝐬𝐢𝐧 𝜽 𝐜𝐨𝐬 𝜽 𝟎 𝟎 𝒔𝒚 𝟎 𝐬𝐢𝐧 𝜽 𝐜𝐨𝐬 𝜽 𝟎 ∙ 𝑷
𝟎 𝟎 𝟏 𝟎 𝟎 𝟏 𝟎 𝟎 𝟏
𝒔𝟏 𝐜𝐨𝐬 𝟐 𝜽 + 𝒔𝟐 𝐬𝐢𝐧𝟐 𝜽 (𝒔𝟐 − 𝒔𝟏 ) 𝐜𝐨𝐬 𝜽 𝐬𝐢𝐧 𝜽 𝟎
 𝑷′ = (𝒔𝟐 − 𝒔𝟏 ) 𝐜𝐨𝐬 𝜽 𝐬𝐢𝐧 𝜽 𝒔𝟏 𝐬𝐢𝐧𝟐 𝜽 + 𝒔𝟐 𝐜𝐨𝐬 𝟐 𝜽 𝟎 ∙ 𝑷
𝟎 𝟎 𝟏
 Here 𝑷′ and 𝑷 are column vector of final and initial point
coordinate respectively and 𝜽 is the angle between actual scaling
direction and our standard coordinate axes.
Announcement
 We will have two lecture of openGL in next week.

You might also like