it is related to Computer Graphics Subject.in this ppt we describe what is 2D Transformation, Translation, Rotation, Scaling : Uniform Scaling,Non-uniform Scaling ;Reflection,Shear,Composite Transformations
it is related to Computer Graphics Subject.in this ppt we describe what is 2D Transformation, Translation, Rotation, Scaling : Uniform Scaling,Non-uniform Scaling ;Reflection,Shear,Composite Transformations
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsVictor Morales
K8sGPT is a tool that analyzes and diagnoses Kubernetes clusters. This presentation was used to share the requirements and dependencies to deploy K8sGPT in a local environment.
Water billing management system project report.pdfKamal Acharya
Our project entitled “Water Billing Management System” aims is to generate Water bill with all the charges and penalty. Manual system that is employed is extremely laborious and quite inadequate. It only makes the process more difficult and hard.
The aim of our project is to develop a system that is meant to partially computerize the work performed in the Water Board like generating monthly Water bill, record of consuming unit of water, store record of the customer and previous unpaid record.
We used HTML/PHP as front end and MYSQL as back end for developing our project. HTML is primarily a visual design environment. We can create a android application by designing the form and that make up the user interface. Adding android application code to the form and the objects such as buttons and text boxes on them and adding any required support code in additional modular.
MySQL is free open source database that facilitates the effective management of the databases by connecting them to the software. It is a stable ,reliable and the powerful solution with the advanced features and advantages which are as follows: Data Security.MySQL is free open source database that facilitates the effective management of the databases by connecting them to the software.
Cosmetic shop management system project report.pdfKamal Acharya
Buying new cosmetic products is difficult. It can even be scary for those who have sensitive skin and are prone to skin trouble. The information needed to alleviate this problem is on the back of each product, but it's thought to interpret those ingredient lists unless you have a background in chemistry.
Instead of buying and hoping for the best, we can use data science to help us predict which products may be good fits for us. It includes various function programs to do the above mentioned tasks.
Data file handling has been effectively used in the program.
The automated cosmetic shop management system should deal with the automation of general workflow and administration process of the shop. The main processes of the system focus on customer's request where the system is able to search the most appropriate products and deliver it to the customers. It should help the employees to quickly identify the list of cosmetic product that have reached the minimum quantity and also keep a track of expired date for each cosmetic product. It should help the employees to find the rack number in which the product is placed.It is also Faster and more efficient way.
Forklift Classes Overview by Intella PartsIntella Parts
Discover the different forklift classes and their specific applications. Learn how to choose the right forklift for your needs to ensure safety, efficiency, and compliance in your operations.
For more technical information, visit our website https://intellaparts.com
HEAP SORT ILLUSTRATED WITH HEAPIFY, BUILD HEAP FOR DYNAMIC ARRAYS.
Heap sort is a comparison-based sorting technique based on Binary Heap data structure. It is similar to the selection sort where we first find the minimum element and place the minimum element at the beginning. Repeat the same process for the remaining elements.
Welcome to WIPAC Monthly the magazine brought to you by the LinkedIn Group Water Industry Process Automation & Control.
In this month's edition, along with this month's industry news to celebrate the 13 years since the group was created we have articles including
A case study of the used of Advanced Process Control at the Wastewater Treatment works at Lleida in Spain
A look back on an article on smart wastewater networks in order to see how the industry has measured up in the interim around the adoption of Digital Transformation in the Water Industry.
Final project report on grocery store management system..pdfKamal Acharya
In today’s fast-changing business environment, it’s extremely important to be able to respond to client needs in the most effective and timely manner. If your customers wish to see your business online and have instant access to your products or services.
Online Grocery Store is an e-commerce website, which retails various grocery products. This project allows viewing various products available enables registered users to purchase desired products instantly using Paytm, UPI payment processor (Instant Pay) and also can place order by using Cash on Delivery (Pay Later) option. This project provides an easy access to Administrators and Managers to view orders placed using Pay Later and Instant Pay options.
In order to develop an e-commerce website, a number of Technologies must be studied and understood. These include multi-tiered architecture, server and client-side scripting techniques, implementation technologies, programming language (such as PHP, HTML, CSS, JavaScript) and MySQL relational databases. This is a project with the objective to develop a basic website where a consumer is provided with a shopping cart website and also to know about the technologies used to develop such a website.
This document will discuss each of the underlying technologies to create and implement an e- commerce website.
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)MdTanvirMahtab2
This presentation is about the working procedure of Shahjalal Fertilizer Company Limited (SFCL). A Govt. owned Company of Bangladesh Chemical Industries Corporation under Ministry of Industries.
Online aptitude test management system project report.pdfKamal Acharya
The purpose of on-line aptitude test system is to take online test in an efficient manner and no time wasting for checking the paper. The main objective of on-line aptitude test system is to efficiently evaluate the candidate thoroughly through a fully automated system that not only saves lot of time but also gives fast results. For students they give papers according to their convenience and time and there is no need of using extra thing like paper, pen etc. This can be used in educational institutions as well as in corporate world. Can be used anywhere any time as it is a web based application (user Location doesn’t matter). No restriction that examiner has to be present when the candidate takes the test.
Every time when lecturers/professors need to conduct examinations they have to sit down think about the questions and then create a whole new set of questions for each and every exam. In some cases the professor may want to give an open book online exam that is the student can take the exam any time anywhere, but the student might have to answer the questions in a limited time period. The professor may want to change the sequence of questions for every student. The problem that a student has is whenever a date for the exam is declared the student has to take it and there is no way he can take it at some other time. This project will create an interface for the examiner to create and store questions in a repository. It will also create an interface for the student to take examinations at his convenience and the questions and/or exams may be timed. Thereby creating an application which can be used by examiners and examinee’s simultaneously.
Examination System is very useful for Teachers/Professors. As in the teaching profession, you are responsible for writing question papers. In the conventional method, you write the question paper on paper, keep question papers separate from answers and all this information you have to keep in a locker to avoid unauthorized access. Using the Examination System you can create a question paper and everything will be written to a single exam file in encrypted format. You can set the General and Administrator password to avoid unauthorized access to your question paper. Every time you start the examination, the program shuffles all the questions and selects them randomly from the database, which reduces the chances of memorizing the questions.
3. Two Dimensional 2D Transformations
What is transformations?
a) The geometrical changes of an object from it’s current
state to another modified state is known as
transformation.
b) “Transformations are the operations applied to existing
geometrical data of an object to change its position,
orientation, or size are called geometric
transformations”.
4. Two Dimensional 2D Transformations
Why the transformations are needed?
• To manipulate the initially created object and to display
the modified object without having to redraw it.
• To Change the shape of object.
• To Study the object surface details.
• To Study the future and past changes in objects.
• To modify old images.
• To get mirror image / Reflections of object.
• To change the color of objects. etc.
5. Two Dimensional 2D Transformations
a) Translation- It is a process of Moving / shifting the position of an
object from one location to another in a straight-line path.
b) Rotation- It is a process rotating an object either
• Around itself.
• In clockwise or anti clockwise direction about any point on screen.
c) Scaling- It is a process enlarging / Compressing an object size.
d) Reflection- It is the process which gives mirror image of an object.
e) Shearing- It is the process where object get distorted in different
shape.
f) Morphing- It is the process where object gets transit from
between two shapes.
g) Coloring- It is process where object gets colored.
Types of Transformations?
6. Two Dimensional 2D Transformations
Process of Transformation:
It is a single step process in computer graphics where original object image
is given as input to transformation process software and returns output as
Transformed object image.
Positional Vector: It is a representation of an original object image in
computers memory. Usually represented in Matrix format (data structure).
Process of Transformations
• Translation
• Rotation
• Scaling
• Reflection
• Shearing
• Morphing
• Coloring
Original
object
image
Transformed
image
Positional
Vector
Transformed
Vector
Geometric Operation /
(Multiplication) [T]
7. Two Dimensional 2D Transformations
Geometric Operation:
• All Transformations can be performed with Mathematical Techniques only.
• In Computer Graphics transformations are performed with Matrix
Calculations only.
• Especially it uses Matrix Multiplication Operation to perform above
transformations.
• It has transformation matrix [ T ] of size 3 x 3 for each type of
Transformation.
• Translation
• Rotation
• Scaling
• Reflection
• Shearing
• Morphing
• Coloring
Original
object
image
Transformed
image
Positional
Vector
Transformed
Vector
Geometric Operation /
(Multiplication) [T]
Process of Transformations
8. Two Dimensional 2D Transformations
Transformed Vector: It is a representation of an Transformed object image
in computers memory. Usually represented in Matrix format (data
structure).
It has same matrix size as that of Positional Vector.
• Translation
• Rotation
• Scaling
• Reflection
• Shearing
• Morphing
• Coloring
Original
object
image
Transformed
image
Positional
Vector
Transformed
Vector
Geometric Operation /
(Multiplication) [T]
Process of Transformations
9. Two Dimensional 2D Transformations
Representation of Original Object /
Positional Vector in Brain
10. Two Dimensional 2D Transformations
Representation of Original Object /
Positional Vector in Brain
11. Two Dimensional 2D Transformations
Representation of Original Object /
Positional Vector in Brain
12. Two Dimensional 2D Transformations
Representation of Original Object /
Positional Vector in Brain
13. Two Dimensional 2D Transformations
Representation of Original Object / Positional Vector
Why do we use matrix to represent Positional Vector?
• More convenient organization of data.
• More efficient processing
• Enable the combination of various concatenations
Example 1: Consider a single point object P
then, the Positional Vector in matrix form is,
as follows,
P =
𝑥
𝑦 OR P = 𝒙 𝒚 P(x,y)
Column
Matrix Form
Row Matrix
Form
Note: In this Presentation we use Row Matrix Form to show all Transformations
14. Two Dimensional 2D Transformations
Representation of Original Object / Positional Vector
Example 2: Consider a line object P1P2 then, the Positional
Vector P in matrix form is, as follows,
P =
𝒙𝟏
𝒚𝟏
OR P =
𝒙𝟏
𝒙𝟐
𝒚𝟏
𝒚𝟐
Column
Matrix Form
Row Matrix
Form
𝒙𝟐
𝒚𝟐
Example 3: Consider a Triangle object
ΔP1P2P3 then, the Positional Vector P in
matrix form is, as follows,
P =
𝒙𝟏
𝒚𝟏
𝒙𝟐
𝒚𝟐
𝒙𝟑
𝒚𝟑
OR P =
𝒙𝟏
𝒙𝟐
𝒙𝟑
𝒚𝟏
𝒚𝟐
𝒚𝟑
P1(x1,y1)
P2(x2,y2)
P3(x3,y3)
15. Two Dimensional 2D Transformations
Homogeneous co-ordinate system Positional Vector
Example 2:
Consider a line object P1P2
P =
𝒙𝟏
𝒙𝟐
𝒚𝟏
𝒚𝟐
𝒛𝟏
𝒛𝟐
Example 3:
Consider a Triangle object ΔP1P2P3
P =
𝒙𝟏
𝒙𝟐
𝒙𝟑
𝒚𝟏
𝒚𝟐
𝒚𝟑
• In 3D system there are three coordinates ( x, y, z ) to represent each pixel P.
• When we perform 2D transformation it is must that all points of the objects
lies in single plane i.e. z = 1.
• When all pixels of the objects lies in same 2D plane e.g. z =1 the these pixels
are known to be in homogeneous co-ordinate system.
𝒛𝟏
𝒛𝟐
𝒛𝟑
When Object pixels are in 3D Space
When Object pixels are in Homogeneous Coordinate system z=1 plane
P =
𝒙𝟏
𝒙𝟐
𝒚𝟏
𝒚𝟐
𝟏
𝟏 P =
𝒙𝟏
𝒙𝟐
𝒙𝟑
𝒚𝟏
𝒚𝟐
𝒚𝟑
𝟏
𝟏
𝟏
Note: In this Presentation we use Homogeneous PV to show all Transformations
16. Two Dimensional 2D Transformations
Transformation Matrix / Geometric Operator [ T ]
• In Computer Graphics it uses matrix multiplications to Perform any
Transformations on set of points represented in positional vector [ P
].
• The Transformation matrix [ T ] is used to performed the desired
Transformation.
• It is assumed that two matrices are known i.e. [ P ] and [ T ] and
these are the input for all transformations.
• The Transformation Matrix [ T ] is of 3 X 3 size i.e. 3 rows and 3 col.
• Following is the Transformation Matrix [ T ].
[ T ] =
𝒂
𝒅
𝒈
𝒃
𝒆
𝒉
𝒄
𝒇
𝒊
• The desired Transformation is obtained with multiplication of [ P ]
and [ T ] matrices. i.e. [ P ] x [ T ] = [ R ]
17. Two Dimensional 2D Transformations
Transformation Matrix / Geometric Operator [ T ]
• The desired Transformation is obtained with multiplication
of [ P ] and [ T ] matrices. i.e. [ P ] x [ T ] = [ R ]
[ R ] = [ P ] . [ T ] =
𝒙𝟏
𝒙𝟐
𝒙𝟑
𝒚𝟏
𝒚𝟐
𝒚𝟑
𝟏
𝟏
𝟏
X
𝒂
𝒅
𝒈
𝒃
𝒆
𝒉
𝒄
𝒇
𝒊
R1 x 3 3 x C2
• The Size of Resultant Matrix [ R ] is R1 x C2
18. Two Dimensional 2D Transformations
Transformation by Unit Matrix
• If the Transformation Matrix [ T ] is Unit Matrix as follows.
• The desired Transformation is obtained with multiplication
of [ P ] and [ T ] matrices. i.e. [ P ] x [ T ] = [ R ]
• Here Transformed Object is same as that of Original Object hence no
transformation has done.
• So Object has not transformed and remain as it is at original positions.
• The Size of Resultant Matrix [ R ] is R1 x C2.
[ T ] =
𝟏
𝟎
𝟎
𝟎
𝟏
𝟎
𝟎
𝟎
𝟏
𝟏
𝟏
𝟏
[ R ] = [ P ] . [ T ] =
𝒙𝟏
𝒙𝟐
𝒙𝟑
𝒚𝟏
𝒚𝟐
𝒚𝟑
X
𝟏
𝟎
𝟎
𝟎
𝟏
𝟎
𝟎
𝟎
𝟏
R1 x 3 3 x C2
=
𝒙𝟏
𝒙𝟐
𝒙𝟑
𝒚𝟏
𝒚𝟐
𝒚𝟑
𝟏
𝟏
𝟏
R1 x C2
19. Two Dimensional 2D Transformations
2D Scaling in Computer Graphics
• In scaling, we can expend or compress the size of any object.
• We can apply scaling on the object by multiplying the original
coordinates with scaling factors Sx and Sy.
• The term scaling factor is used to define whether the size of an
object is increased or decreased.
• We can represent the scaling factor by ‘Sx’ for the x-axis and
‘Sy’ for the y-axis.
• The Scaling Transformation is obtained with multiplication of
[ P ] and [ T ] matrices. i.e. [ P ] x [ T ] = [ R ].
• The Size of Resultant Matrix [ R ] is R1 x C2
𝟏
𝟏
𝟏
[ R ] = [ P ] . [ T ] =
𝒙𝟏
𝒙𝟐
𝒙𝟑
𝒚𝟏
𝒚𝟐
𝒚𝟑
X
𝑺𝒙
𝟎
𝟎
𝟎
𝑺𝒚
𝟎
𝟎
𝟎
𝟏
R1 x 3 3 x C2
=
𝑺𝒙 . 𝒙𝟏
𝑺𝒙 . 𝒙𝟐
𝑺𝒙 . 𝒙𝟑
𝑺𝒚 . 𝒚𝟏
𝑺𝒚 . 𝒚𝟐
𝑺𝒚 . 𝒚𝟑
𝟏
𝟏
𝟏
R1 x C2
20. Two Dimensional 2D Transformations
2D Scaling in Computer Graphics
𝟏
𝟏
𝟏
𝟏
[ R ] = [ P ] . [ T ] =
𝟏
𝟒
𝟒
𝟏
𝟒
𝟒
𝟏
𝟏
X
𝟑
𝟎
𝟎
𝟎
𝟒
𝟎
𝟎
𝟎
𝟏
R1 x 3 3 x C2
=
𝟑
𝟏𝟐
𝟏𝟐
𝟑
𝟏𝟔
𝟏𝟔
𝟒
𝟒
𝟏
𝟏
𝟏
𝟏
R1 x C2
• Example: A Square object
with the coordinate points D
(1, 4), C (4, 4), B (4, 1), A
(1,1).
• Apply the scaling factor 3 on
the X-axis and 4 on the Y-
axis.
• Find out the new coordinates
of the square?
21. Two Dimensional 2D Transformations
2D Scaling in Computer Graphics - Enlargement
𝟏
𝟏
𝟏
𝟏
[ R ] = [ P ] . [ T ] =
𝟏
𝟒
𝟒
𝟏
𝟒
𝟒
𝟏
𝟏
X
𝟑
𝟎
𝟎
𝟎
𝟒
𝟎
𝟎
𝟎
𝟏
R1 x 3 3 x C2
=
𝟑
𝟏𝟐
𝟏𝟐
𝟑
𝟏𝟔
𝟏𝟔
𝟒
𝟒
𝟏
𝟏
𝟏
𝟏
R1 x C2
22. Two Dimensional 2D Transformations
2D Scaling in Computer Graphics compression
𝟏
𝟏
𝟏
𝟏
[ R ] = [ P ] . [ T ] =
𝟏
𝟒
𝟒
𝟏
𝟒
𝟒
𝟏
𝟏
X
𝟏
𝟎
𝟎
𝟎
𝟎. 𝟐𝟓
𝟎
𝟎
𝟎
𝟏
4 x 3 3 x C2
=
𝟏
𝟒
𝟒
𝟏
𝟏
𝟏
𝟎. 𝟐𝟓
𝟎. 𝟐𝟓
𝟏
𝟏
𝟏
𝟏
R1 x C2
• Example: A Square object
with the coordinate points D
(1, 4), C (4, 4), B (4, 1), A
(1,1).
• Apply the scaling factor 1 on
the X-axis and 0.25 on the Y-
axis.
• Find out the new coordinates
of the square?
23. Two Dimensional 2D Transformations
2D Scaling in Computer Graphics - Compression
𝟏
𝟏
𝟏
𝟏
[ R ] = [ P ] . [ T ] =
𝟏
𝟒
𝟒
𝟏
𝟒
𝟒
𝟏
𝟏
X
𝟏
𝟎
𝟎
𝟎
𝟎. 𝟐𝟓
𝟎
𝟎
𝟎
𝟏
4 x 3 3 x C2
=
𝟏
𝟒
𝟒
𝟏
𝟏
𝟏
𝟎. 𝟐𝟓
𝟎. 𝟐𝟓
𝟏
𝟏
𝟏
𝟏
R1 x C2
24. Two Dimensional 2D Transformations
2D Scaling Rules in Computer Graphics
T= identity matrix:
a=e=i=1, b=c=d==f=g=h=0 Results for all x’ = x, y’ = y.
Scaling Rules by parameters a and e :
b=c=d==f=g=h=0 => x' = a.x, y' = e.y; This is scaling by a in x, d in y.
• If, a = e > 1, we have enlargement (scale up) & uniform scaling.
• If, a ≠ e > 1, we have enlargement (scale up) & non-uniform scaling.
• If, 0 < a = e < 1, we have compression (scale down) & uniform scaling.
• If, 0 < a ≠ e < 1, we have compression (scale down) & non-uniform
scaling.
Uniform Scaling by parameter i: a = e = 1 and b=c=d==f=g=h=0
• If, i > 1, we have compression (scale down) & uniform scaling.
• If, i < 1, we have enlargement (scale up) & uniform scaling.
• If, i = 1, we have [ T ] as Unit Matrix hence results for all x’ = x, y’ = y.
[ T ] =
𝒂
𝒅
𝒈
𝒃
𝒆
𝒉
𝒄
𝒇
𝒊
25. Two Dimensional 2D Transformations
2D Scaling in Computer Graphics compression
𝟏
𝟏
𝟏
𝟏
[ R ] = [ P ] . [ T ] =
𝟏
𝟒
𝟒
𝟏
𝟒
𝟒
𝟏
𝟏
X
𝟏
𝟎
𝟎
𝟎
𝟏
𝟎
𝟎
𝟎
𝟐
4 x 3 3 x 3
=
𝟏
𝟒
𝟒
𝟏
𝟒
𝟒
𝟏
𝟏
𝟐
𝟐
𝟐
𝟐
4 x 3
• Example: A Square object with the coordinate points D (1, 4), C (4, 4), B
(4, 1), A (1,1). Apply the scaling factor 2 on both axis. Find out the new
coordinates of the square?
Some Observations and Imaginations are,
26. Two Dimensional 2D Transformations
2D Scaling in Computer Graphics compression
• Here Original object Matrix [ P ] is in One Homogeneous Co-ordinate Plane (z=1) plane.
• And The Resultant object Matrix [ R ] which is of same size, lies in another
Homogeneous Co-ordinate Plane (z=2) plane.
• It is needed to bring Resultant object of [ R ] in the same plane of [ P ] i.e. z = 1
• Divide each row of [ R ] by third column element
[ R ] =
𝟎. 𝟓
𝟐
𝟐
𝟎. 𝟓
𝟐
𝟐
𝟎. 𝟓
𝟎. 𝟓
𝟏
𝟏
𝟏
𝟏
𝟏
𝟒
𝟒
𝟏
𝟒
𝟒
𝟏
𝟏
𝟐
𝟐
𝟐
𝟐
[ R ] =
28. Two Dimensional 2D Transformations
2D Scaling in Computer Graphics compression
𝟏
𝟏
𝟏
𝟏
[ R ] = [ P ] . [ T ] =
𝟏
𝟒
𝟒
𝟏
𝟒
𝟒
𝟏
𝟏
X
𝟏
𝟎
𝟎
𝟎
𝟏
𝟎
𝟎
𝟎
𝟎. 𝟓
4 x 3 3 x 3
=
𝟏
𝟒
𝟒
𝟏
𝟒
𝟒
𝟏
𝟏
𝟎. 𝟓
𝟎. 𝟓
𝟎. 𝟓
𝟎. 𝟓
4 x 3
• Example: A Square object with the coordinate points D (1, 4), C (4, 4), B
(4, 1), A (1,1). Apply the scaling factor 0.5 on both axis. Find out the new
coordinates of the square?
Some Observations and Imaginations are,
29. Two Dimensional 2D Transformations
2D Scaling in Computer Graphics compression
• Here Original object Matrix [ P ] is in One Homogeneous Co-ordinate Plane (z=1) plane.
• And The Resultant object Matrix [ R ] which is of same size, lies in another
Homogeneous Co-ordinate Plane (z=0.5) plane.
• It is needed to bring Resultant object of [ R ] in the same plane of [ P ] i.e. z = 1
• Divide each row of [ R ] by third column element
[ R ] =
𝟐
𝟖
𝟖
𝟐
𝟖
𝟖
𝟐
𝟐
𝟏
𝟏
𝟏
𝟏
[ R ] =
𝟏
𝟒
𝟒
𝟏
𝟒
𝟒
𝟏
𝟏
𝟎. 𝟓
𝟎. 𝟓
𝟎. 𝟓
𝟎. 𝟓
30. Two Dimensional 2D Transformations
2D Scaling in Computer Graphics compression
[ R ] =
𝟐
𝟖
𝟖
𝟐
𝟖
𝟖
𝟐
𝟐
𝟏
𝟏
𝟏
𝟏
31. Two Dimensional 2D Transformations
2D Reflection in Computer Graphics
• It is a transformation which produces a mirror image of an object.
• The mirror image can be either about x-axis or y-axis.
• The object is rotated by180°.
• Types of Reflection:
a) Reflection about the x-axis (𝒓𝒙 = 1, 𝒓𝒚 = -1)
b) Reflection about the y-axis (𝒓𝒙 = -1, 𝒓𝒚 = 1)
c) Reflection about an axis perpendicular to xy plane and passing through
the origin. (𝒓𝒙 = -1, 𝒓𝒚 = -1)
d) Reflection about line y=x
• Here 𝒓𝒚 , 𝒓𝒙 can be either -1 for reflection.
• The Reflection Transformation is obtained with multiplication of [ P ] and [ T ]
matrices. i.e. [ P ] x [ T ] = [ R ].
• The Size of Resultant Matrix [ R ] is R1 x C2.
𝟏
𝟏
𝟏
[ R ] = [ P ] . [ T ] =
𝒙𝟏
𝒙𝟐
𝒙𝟑
𝒚𝟏
𝒚𝟐
𝒚𝟑
X
𝒓𝒙
𝟎
𝟎
𝟎
𝒓𝒚
𝟎
𝟎
𝟎
𝟏
R1 x 3 3 x 3
=
𝒓𝒙. 𝒙𝟏
𝒓𝒙. 𝒙𝟐
𝒓𝒙. 𝒙𝟑
𝒓𝒚. 𝒚𝟏
𝒓𝒚. 𝒚𝟐
𝒓𝒚. 𝒚𝟑
𝟏
𝟏
𝟏
R1 x 3
32. Two Dimensional 2D Transformations
2D Reflection in Computer Graphics
• 1. Reflection about x-axis: The object
can be reflected about x-axis with the help
of the following matrix
• In this transformation value of x will
remain same whereas the value of y will
become negative.
• The Reflection Transformation is obtained
with multiplication of [ P ] and [ T ]
matrices. i.e. [ P ] x [ T ] = [ R ].
• The Size of Resultant Matrix [ R ] is R1 x
C2.
𝟏
𝟏
𝟏
[ R ] = [ P ] . [ T ] =
𝒙𝟏
𝒙𝟐
𝒙𝟑
𝒚𝟏
𝒚𝟐
𝒚𝟑
X
𝟏
𝟎
𝟎
𝟎
−𝟏
𝟎
𝟎
𝟎
𝟏
R1 x 3 3 x 3
=
𝒙𝟏
𝒙𝟐
𝒙𝟑
−𝒚𝟏
−𝒚𝟐
−𝒚𝟑
𝟏
𝟏
𝟏
R1 x C2
[ T ] =
• Following figures shows the
reflection of the object axis.
• The object will lie another side of
the x-axis
33. Two Dimensional 2D Transformations
2D Reflection in Computer Graphics
• 2. Reflection about y-axis: The object
can be reflected about y-axis with the help
of following transformation matrix
• In this transformation value of y will
remain same whereas the value of x will
become negative.
• The Reflection Transformation is obtained
with multiplication of [ P ] and [ T ]
matrices. i.e. [ P ] x [ T ] = [ R ].
• The Size of Resultant Matrix [ R ] is R1 x
C2.
𝟏
𝟏
𝟏
[ R ] = [ P ] . [ T ] =
𝒙𝟏
𝒙𝟐
𝒙𝟑
𝒚𝟏
𝒚𝟐
𝒚𝟑
X
−𝟏
𝟎
𝟎
𝟎
𝟏
𝟎
𝟎
𝟎
𝟏
R1 x 3 3 x 3
=
−𝒙𝟏
−𝒙𝟐
−𝒙𝟑
𝒚𝟏
𝒚𝟐
𝒚𝟑
𝟏
𝟏
𝟏
R1 x C2
• The following figure shows the
reflection about the y-axis
[ T ] =
34. Two Dimensional 2D Transformations
2D Reflection in Computer Graphics
• 3. Reflection about an axis
perpendicular to xy plane and passing
through origin:
• In this value of x and y both will be
reversed. This is also called as half
revolution about the origin.
• The Reflection Transformation is obtained
with multiplication of [ P ] and [ T ]
matrices. i.e. [ P ] x [ T ] = [ R ].
• The Size of Resultant Matrix [ R ] is R1 x
C2.
𝟏
𝟏
𝟏
[ R ] = [ P ] . [ T ] =
𝒙𝟏
𝒙𝟐
𝒙𝟑
𝒚𝟏
𝒚𝟐
𝒚𝟑
X
−𝟏
𝟎
𝟎
𝟎
−𝟏
𝟎
𝟎
𝟎
𝟏
R1 x 3 3 x 3
=
−𝒙𝟏
−𝒙𝟐
−𝒙𝟑
−𝒚𝟏
−𝒚𝟐
−𝒚𝟑
𝟏
𝟏
𝟏
R1 x C2
• The following figure shows the
reflection about an axis
perpendicular to xy plane
[ T ] =
35. Two Dimensional 2D Transformations
2D Reflection in Computer Graphics
• 3. Reflection about an axis
perpendicular to xy plane and passing
through origin:
• In this value of x and y both will be
reversed. This is also called as half
revolution about the origin.
• The Reflection Transformation is obtained
with multiplication of [ P ] and [ T ]
matrices. i.e. [ P ] x [ T ] = [ R ].
• The Size of Resultant Matrix [ R ] is R1 x
C2.
𝟏
𝟏
𝟏
[ R ] = [ P ] . [ T ] =
𝒙𝟏
𝒙𝟐
𝒙𝟑
𝒚𝟏
𝒚𝟐
𝒚𝟑
X
−𝟏
𝟎
𝟎
𝟎
−𝟏
𝟎
𝟎
𝟎
𝟏
R1 x 3 3 x 3
=
−𝒙𝟏
−𝒙𝟐
−𝒙𝟑
−𝒚𝟏
−𝒚𝟐
−𝒚𝟑
𝟏
𝟏
𝟏
R1 x C2
• The following figure shows the
reflection about an axis
perpendicular to xy plane
[ T ] =
36. Two Dimensional 2D Transformations
2D Reflection in Computer Graphics
• 4. Reflection about line y=x: The object
may be reflected about line y = x with the
help of following transformation matrix
• In this value of x and y both will be
exchanged. This is also called as
reflection about y=x line.
• The Reflection Transformation is obtained
with multiplication of [ P ] and [ T ]
matrices. i.e. [ P ] x [ T ] = [ R ].
• The Size of Resultant Matrix [ R ] is R1 x
C2.
𝟏
𝟏
𝟏
[ R ] = [ P ] . [ T ] =
𝒙𝟏
𝒙𝟐
𝒙𝟑
𝒚𝟏
𝒚𝟐
𝒚𝟑
X
𝟎
𝟏
𝟎
𝟏
𝟎
𝟎
𝟎
𝟎
𝟏
=
𝒚𝟏
𝒚𝟐
𝒚𝟑
𝒙𝟏
𝒙𝟐
𝒙𝟑
𝟏
𝟏
𝟏
R1 x C2
• The following figure shows the
reflection about an x=y line
[ T ] =
37. Two Dimensional 2D Transformations
2D Reflection in Computer Graphics
Problem-01: Given a triangle with coordinate points A(3, 4), B(6, 4), C(5, 6). Apply the reflection on the
X axis and obtain the new coordinates of the object.
𝟏
𝟏
𝟏
[ R ] = [ P ] . [ T ] =
𝟑
𝟔
𝟓
𝟒
𝟒
𝟔
X
𝟏
𝟎
𝟎
𝟎
−𝟏
𝟎
𝟎
𝟎
𝟏
R1 x 3 3 x 3
=
𝟑
𝟔
𝟓
−𝟒
−𝟒
−𝟔
𝟏
𝟏
𝟏
R1 x C2
Problem-02: Given a triangle with coordinate points A(3, 4), B(6, 4), C(5, 6). Apply the reflection on the
X=Y Line to obtain the new coordinates of the object.
𝟏
𝟏
𝟏
[ R ] = [ P ] . [ T ] =
𝟑
𝟔
𝟓
𝟒
𝟒
𝟔
X
𝟎
𝟏
𝟎
𝟏
𝟎
𝟎
𝟎
𝟎
𝟏
R1 x 3 3 x 3
=
𝟒
𝟒
𝟔
𝟑
𝟔
𝟓
𝟏
𝟏
𝟏
R1 x C2
Problem-03: Given a triangle with coordinate points A(3, 4), B(6, 4), C(5, 6). Apply the reflection on the
Y axis to obtain the new coordinates of the object.
38. Two Dimensional 2D Transformations
2D Translation in Computer Graphics
• We can move any object from one to
another place without changing the shape
of the object.
• Translation of a Point: If we want to
translate a point from P (x0, y0) to Q (x1,
y1), then we have to add Translation
coordinates (Tx, Ty) with original
coordinates.
• The Translation Transformation is
obtained with multiplication of [ P ] and [
T ] matrices. i.e. [ P ] x [ T ] = [ R ].
• The Size of Resultant Matrix [ R ] is R1 x
C2.
𝟏
𝟏
𝟏
[ R ] = [ P ] . [ T ] =
𝒙𝟏
𝒙𝟐
𝒙𝟑
𝒚𝟏
𝒚𝟐
𝒚𝟑
X
𝟏
𝟎
𝑻𝒙
𝟎
𝟏
𝑻𝒚
𝟎
𝟎
𝟏
=
𝒙𝟏 + 𝑻𝒙
𝒙𝟐 + 𝑻𝒙
𝒙𝟑 + 𝑻𝒙
𝒚𝟏 + 𝑻𝒚
𝒚𝟐 + 𝑻𝒚
𝒚𝟑 + 𝑻𝒚
R1 x C2
• The following figure shows the
translation from P to Q Pixel.
𝟏
𝟏
𝟏
39. Two Dimensional 2D Transformations
2D Rotation in Computer Graphics
• In rotation, we rotate the object at
particular angle θ theta from its origin.
• From the following figure, we can see that
the point P(X,Y) is located at angle φ from
the horizontal X coordinate with distance
r from the origin.
• Let us suppose you want to rotate it at
the angle θ.
• The Rotation Transformation is obtained
with multiplication of [ P ] and [ T ]
matrices. i.e. [ P ] x [ T ] = [ R ].
• The Size of Resultant Matrix [ R ] is R1 x
C2.
• After rotating it to a new location,
you will get a new point P’ (X′,Y′).
40. Two Dimensional 2D Transformations
2D Anticlockwise Rotation in Computer Graphics
• Using standard trigonometric the original
coordinate of point P(X,Y) can be represented
as −
• X=rcosϕ......(1)
• Y=rsinϕ......(2)
• Same way we can represent the point P’ X′,Y′
as −
• x′=rcos(ϕ+θ)=r cosϕcosθ−r
sinϕsinθ.......(3)
• y′=rsin(ϕ+θ)=r cosϕsinθ+r
sinϕcosθ.......(4)
• Substituting equation 1 & 2 in 3 & 4
respectively, we will get
• x′ = xcosθ − ysinθ
• y′ = xsinθ + ycosθ
• Representing the above equation in matrix
[ R ] =[ X Y ] x
cos(θ) sin(θ)
−sin(θ) cos(θ)
0
0
1
𝒄𝒐𝒔(θ) 𝒔𝒊𝒏(θ)
−𝒔𝒊𝒏(θ)
𝟎
𝒄𝒐𝒔(θ)
𝟎
For Anti-clockwise Rotation
[ T ]=
41. Two Dimensional 2D Transformations
2D Clockwise Rotation in Computer Graphics
For clockwise Rotation
• Consider Previous equations,
• x′ = xcosθ − ysinθ .......(5)
• y′ = xsinθ + ycosθ .......(6)
• Substituting equation -θ in 5 & 6, we will get
• x′ = xcos(-θ) − y sin(-θ) .......(5)
• y′ = xsin(-θ) + ycos(-θ) .......(6)
• Becomes,
• x′ = xcosθ − ( - ysinθ)
• y′ = -xsinθ + ycosθ
• Results
• x′ = xcosθ + ysinθ .......(7)
• y′ = -xsinθ + ycosθ .......(8)
• Representing the above equation in matrix
form,
[ R ] =[ X Y ] x
cos(θ) −sin(θ)
sin(θ) cos(θ)
0
0
1
𝒄𝒐𝒔(θ) −𝒔𝒊𝒏(θ)
𝒔𝒊𝒏(θ)
𝟎
𝒄𝒐𝒔(θ)
𝟎
For clockwise Rotation
[ T ]=
42. Two Dimensional 2D Transformations
2D Shearing in Computer Graphics
• A transformation that slants the shape of an object is called the shear
transformation.
• There are two shear transformations
• X-Shear
• Y-Shear.
• X-Y Shear.
• One shifts X coordinates values and other shifts Y coordinate values.
• However in both the cases only one coordinate changes its coordinates and
other preserves its values.
• Shearing is also termed as Skewing.
43. Two Dimensional 2D Transformations
2D Shearing in Computer Graphics
X-Shear:
• The X-Shear preserves the Y coordinate and changes are made to X
coordinates, which causes the vertical lines to tilt right or left as shown in
below figure.
The transformation matrix for X-Shear can be represented as −
𝟏
𝟏
𝟏
𝟏 𝑺𝒉𝒙
𝟎
𝟎
𝟏
𝟎
For X-Shear
[ T ]=
44. Two Dimensional 2D Transformations
2D Shearing in Computer Graphics
Y-Shear:
• The Y-Shear preserves the X coordinates and changes the Y coordinates
which causes the horizontal lines to transform into lines which slopes up or
down as shown in the following figure.
The transformation matrix for Y-Shear can be represented as −
𝟏
𝟏
𝟏
𝟏 𝟎
𝑺𝒉𝒚
𝟎
𝟏
𝟎
For Y-Shear
[ T ]=
45. Two Dimensional 2D Transformations
2D Shearing in Computer Graphics
X-Y-Shear:
• The XY-Shear changes the X and Y coordinates which causes the horizontal
and vertical lines to transform into lines which slopes up and down as
shown in the following figure.
The transformation matrix for Y-Shear can be represented as −
𝟏
𝟏
𝟏
𝟏 𝑺𝒉𝒙
𝑺𝒉𝒚
𝟎
𝟏
𝟎
For Y-Shear
[ T ]=
46. Two Dimensional 2D Transformations
Composite / Concatenation / Combined Transformation
• If a transformation of the plane T1 is followed by a second plane transformation T2,
then the result itself may be represented by a single transformation T which is the
composition of T1 and T2 taken in that order.
• This is written as T = [ T1 ] ∙ [ T2 ].
• Composite transformation can be achieved by concatenation of transformation
matrices to obtain a combined transformation matrix.
• A combined matrix − [ T ] = [ T1 ] [ T2 ] [ T3 ] [ T4 ] …. [ Tn ]
• Where [Ti] is any combination of- Translation, Scaling, Shearing, Rotation,
Reflection
• The change in the order of transformation would lead to different results, as in
general matrix multiplication is not cumulative, that is [A] . [B] ≠ [B] . [A] and the
order of multiplication.
• The basic purpose of composing transformations is to gain efficiency by applying a
single composed transformation to a point, rather than applying a series of
transformation, one after another.