SlideShare a Scribd company logo
1 of 29
Download to read offline
2-D Transformations
• Points and lines that joins them, with appropriate drawing
algorithms, represents objects/information graphically.
• Ability to transform these points and lines is basic to
computer graphics.
• In 2-D Objects, transformation is to change the objects:
- Position (Translation)
- Size (Scaling)
- Orientation (Rotation)
- Shapes (Shear)
- Reflection (Mirror image)
Point Representation
• A Point is represented in 2-Dimensions by its coordinates.
• We can use a column vector (a 2x1 matrix) or row vector(1x2)
to represent a 2D point : or [x y]
• Row matrices or column matrices are frequently called
position vectors.
• Series of points, each of which is position vectors relative to
some coordinate system is stored in computer as a matrix or
array of numbers.
• Lines are drawn between the points to generate lines, curves
or pictures.
Transformation of Points
• [X][T] = [x y] [ ]= [ (ax + cy) (bx + dy)] = [x’ y’]
Where, x’ = (ax + cy) and y’ = (bx + dy)
Case 1: Let, a=d=1 & c=b=0. The transformation matrix [T], then
reduces to the identity matrix. Thus,
[X][T] = [x y] [ ]= [x y] = [x’ y’],no changes as multiplying
with identity matrix gives us same result.
Case 2: Let, d=1, b=c=0,then,
[X][T] = [x y] [ ]= [ax y] = [x’ y’],
where x’ = ax, produces a scale change in x component.
a b
c d
1 0
0 1
a 0
0 1
Case 3: Let, b=c=0, i.e.,
[X][T] = [x y] [ ]= [ax dy] = [x’ y’], resulting in scaling
of both x and y components.
- If a ≠ d, means scaling are not equal.
- If a = d > 1, pure enlargement/scaling of coordinates occurs.
- If 0 < a = d < 1, compression of coordinates of point P occurs.
a 0
0 d
Case 4: If a and/or d are negative, then reflection through a
plane or axis can be seen. Let b=c=0, d=1,a= -1, then
[X][T] = [x y] [ ]= [-x y] = [x’ y’], reflection through y-
axis results.
- If b=c=0, a=1,d= -1,reflection through x-axis.
- If b=c=0,a=d<0, reflection through origin occurs.
-1 0
0 1
Case 5: let a=d=1,c=0,thus
[X][T] = [x y] [ ]= [x (bx+y)] = [x’ y’], it causes
shearing effect. Here x’ is unchanged, but y’ depends on y.
- if a=d=1,b=0. produces shear proportional to y coordinate.
1 b
0 1
Straight line transformation
• Position vector are: [A]=[0 1], [B]=[2 3]
• Let transformation matrix, [T] = [ ],due to shearing
effect.
1 2
3 1
• Transforming the position vectors for A & B using [T] produces new
vectors A’ and B’ given by:
[A] [T]= [0 1] [ ] = [3 1] = [A’] , and
[B] [T]= [2 3] [ ] = [11 7] = [B’]
• Resulting coordinates for new point A’ are x’=3, y’=1 and B’ are
x’= 11 and y’=7.
• From the Fig., Shearing transformation [T] increased the length of
the line and changes its orientation.
1 2
3 1
1 2
3 1
Midpoint Transformation
Transformation of Parallel lines
• If a 2x2 matrix is used to transform a pair of parallel lines, the
result is a second pair of parallel lines
Transformation of Intersecting lines
• When two intersecting lines are transformed using general
2x2 transformation matrix the resulting lines are also
intersecting. Consider 2 intersection lines
• Points of intersection:
• Transformed point of intersection:
Rotation
• 2D Rotation
– Rotation axis
– Rotation angle
– rotation point or pivot point (xr,yr)
• 2D Rotation
– If θ is positive  counterclockwise rotation
– If θ is negative  clockwise rotation
– Remember:
• cos(a + b) = cos a cos b - sin a sin b
• cos(a - b) = cos a sin b + sin a cos b
– At first, suppose the pivot point is at the origin
– x’=r cos(θ+Φ) = r cos θ cos Φ - r sin θ sin Φ
y’=r sin(θ+Φ) = r cos θ sin Φ + r sin θ cos Φ
– Let, x = r cos Φ, y = r sin Φ
– x’=x cos θ - y sin θ
y’=x sin θ + y cos θ
• 2D Rotation
– P’=R·P, where P is the point with coordinate (x,y) and P’ is
the new point with coordinate (x’,y’).












cos
sin
sin
cos
R
Φ
(x,y)
r
r θ
(x’,y’)
• 2D Rotation
– Rotation of a point about any specified position (xr,yr)
x’=xr+(x - xr) cos θ – (y - yr) sin θ
y’=yr+(x - xr) sin θ + (y - yr) cos θ
- Rotations also move objects without deformation
– A line is rotated by applying the rotation formula to each
of the endpoints and redrawing the line between the new
end points
– A polygon is rotated by applying the rotation formula to
each of the vertices and redrawing the polygon using new
vertex coordinates
• 2D Inverse Rotation Matrix
• And also:

















1
0
0
0
cos
sin
0
sin
cos
1
R
I
R
R 

*
1
Reflection
• Reflection
– Image is generated relative to an axis of reflection by
rotating the object 180° about the reflection axisect
– Transformation that produces a mirror image of an object
– Reflection about the line y=0 (the x axis)
[T] =











1
0
0
0
1
0
0
0
1
• Reflection about the line x=0 (the y axis)
[T] =
• Reflection about the origin
[T] =










1
0
0
0
1
0
0
0
1
• Reflection about the line y=x
[T] =
• Reflection about the line y=-x
[T] =
Scaling
• 2D Scaling
– Scaling is used to alter the size of an object
– Simple 2D scaling is performed by multiplying object
positions (x, y) by scaling factors sx and sy
x’ = x · sx
y’ = y · sy
• or P’ = S·P




















y
x
s
s
y
x
y
x
0
0
'
'
• 2D Scaling
– Any positive value can be used as scaling factor
• Values less than 1 reduce the size of the object
• Values greater than 1 enlarge the object
• If scaling factor is 1 then the object stays unchanged
• If sx = sy , we call it uniform scaling
• If scaling factor <1, then the object moves closer to the
origin and If scaling factor >1, then the object moves
farther from the origin
• 2D Scaling
– We can control the location of the scaled object by
choosing a position called the fixed point (xf,yf)
x’ – xf = (x – xf) sx y’ – yf = (y – yf) sy
x’=x · sx + xf (1 – sx)
y’=y · sy + yf (1 – sy)
– Polygons are scaled by applying the above formula to each
vertex, then regenerating the polygon using the
transformed vertices
Composite transformation
• We can setup a sequence of transformations as a composite
transformation matrix by calculating the product of the
individual transformations
• P’=M2·M1·P
=M·P
• Composite 2D Translations
– If two successive translation are applied to a point P, then
the final transformed location P' is calculated as
• Composite 2D rotation:
• Composite 2D Scaling:
Area scaling example

More Related Content

What's hot

3D TRANSFORMATION: MATRIX REPRESENTATION
3D TRANSFORMATION: MATRIX REPRESENTATION3D TRANSFORMATION: MATRIX REPRESENTATION
3D TRANSFORMATION: MATRIX REPRESENTATIONAhtesham Ullah khan
 
ITK Tutorial Presentation Slides-947
ITK Tutorial Presentation Slides-947ITK Tutorial Presentation Slides-947
ITK Tutorial Presentation Slides-947Kitware Kitware
 
What Is A Game Engine
What Is A Game EngineWhat Is A Game Engine
What Is A Game EngineSeth Sivak
 
1-Introduction (Game Design and Development)
1-Introduction (Game Design and Development)1-Introduction (Game Design and Development)
1-Introduction (Game Design and Development)Hafiz Ammar Siddiqui
 
Book of the Dead: Environmental Design, Tools, and Techniques for Photo-Real ...
Book of the Dead: Environmental Design, Tools, and Techniques for Photo-Real ...Book of the Dead: Environmental Design, Tools, and Techniques for Photo-Real ...
Book of the Dead: Environmental Design, Tools, and Techniques for Photo-Real ...Unity Technologies
 
1. Introduction of Computer Graphics
1. Introduction of Computer Graphics1. Introduction of Computer Graphics
1. Introduction of Computer GraphicsAparna Joshi
 
Graphics_3D viewing
Graphics_3D viewingGraphics_3D viewing
Graphics_3D viewingRabin BK
 
Optimizing the graphics pipeline with compute
Optimizing the graphics pipeline with computeOptimizing the graphics pipeline with compute
Optimizing the graphics pipeline with computeWuBinbo
 
Composite transformations
Composite transformationsComposite transformations
Composite transformationsMohd Arif
 
OpenGL 3.2 and More
OpenGL 3.2 and MoreOpenGL 3.2 and More
OpenGL 3.2 and MoreMark Kilgard
 
UNIT-6-Illumination-Models-and-Surface-Rendering-Methods.pdf
UNIT-6-Illumination-Models-and-Surface-Rendering-Methods.pdfUNIT-6-Illumination-Models-and-Surface-Rendering-Methods.pdf
UNIT-6-Illumination-Models-and-Surface-Rendering-Methods.pdfSayantanMajhi2
 
06. Game Architecture
06. Game Architecture06. Game Architecture
06. Game ArchitectureAmin Babadi
 
Choosing your Game Engine (2009)
Choosing your Game Engine (2009)Choosing your Game Engine (2009)
Choosing your Game Engine (2009)Mark DeLoura
 
Dx11 performancereloaded
Dx11 performancereloadedDx11 performancereloaded
Dx11 performancereloadedmistercteam
 
Parallel Futures of a Game Engine (v2.0)
Parallel Futures of a Game Engine (v2.0)Parallel Futures of a Game Engine (v2.0)
Parallel Futures of a Game Engine (v2.0)Johan Andersson
 
Five Rendering Ideas from Battlefield 3 & Need For Speed: The Run
Five Rendering Ideas from Battlefield 3 & Need For Speed: The RunFive Rendering Ideas from Battlefield 3 & Need For Speed: The Run
Five Rendering Ideas from Battlefield 3 & Need For Speed: The RunElectronic Arts / DICE
 

What's hot (20)

3D TRANSFORMATION: MATRIX REPRESENTATION
3D TRANSFORMATION: MATRIX REPRESENTATION3D TRANSFORMATION: MATRIX REPRESENTATION
3D TRANSFORMATION: MATRIX REPRESENTATION
 
ITK Tutorial Presentation Slides-947
ITK Tutorial Presentation Slides-947ITK Tutorial Presentation Slides-947
ITK Tutorial Presentation Slides-947
 
What Is A Game Engine
What Is A Game EngineWhat Is A Game Engine
What Is A Game Engine
 
1-Introduction (Game Design and Development)
1-Introduction (Game Design and Development)1-Introduction (Game Design and Development)
1-Introduction (Game Design and Development)
 
Book of the Dead: Environmental Design, Tools, and Techniques for Photo-Real ...
Book of the Dead: Environmental Design, Tools, and Techniques for Photo-Real ...Book of the Dead: Environmental Design, Tools, and Techniques for Photo-Real ...
Book of the Dead: Environmental Design, Tools, and Techniques for Photo-Real ...
 
1. Introduction of Computer Graphics
1. Introduction of Computer Graphics1. Introduction of Computer Graphics
1. Introduction of Computer Graphics
 
Graphics_3D viewing
Graphics_3D viewingGraphics_3D viewing
Graphics_3D viewing
 
Optimizing the graphics pipeline with compute
Optimizing the graphics pipeline with computeOptimizing the graphics pipeline with compute
Optimizing the graphics pipeline with compute
 
Composite transformations
Composite transformationsComposite transformations
Composite transformations
 
OpenGL 3.2 and More
OpenGL 3.2 and MoreOpenGL 3.2 and More
OpenGL 3.2 and More
 
3D Transformation
3D Transformation 3D Transformation
3D Transformation
 
Rendering Battlefield 4 with Mantle
Rendering Battlefield 4 with MantleRendering Battlefield 4 with Mantle
Rendering Battlefield 4 with Mantle
 
UNIT-6-Illumination-Models-and-Surface-Rendering-Methods.pdf
UNIT-6-Illumination-Models-and-Surface-Rendering-Methods.pdfUNIT-6-Illumination-Models-and-Surface-Rendering-Methods.pdf
UNIT-6-Illumination-Models-and-Surface-Rendering-Methods.pdf
 
06. Game Architecture
06. Game Architecture06. Game Architecture
06. Game Architecture
 
Choosing your Game Engine (2009)
Choosing your Game Engine (2009)Choosing your Game Engine (2009)
Choosing your Game Engine (2009)
 
Dx11 performancereloaded
Dx11 performancereloadedDx11 performancereloaded
Dx11 performancereloaded
 
Parallel Futures of a Game Engine (v2.0)
Parallel Futures of a Game Engine (v2.0)Parallel Futures of a Game Engine (v2.0)
Parallel Futures of a Game Engine (v2.0)
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer Graphics
 
Ray tracing
Ray tracingRay tracing
Ray tracing
 
Five Rendering Ideas from Battlefield 3 & Need For Speed: The Run
Five Rendering Ideas from Battlefield 3 & Need For Speed: The RunFive Rendering Ideas from Battlefield 3 & Need For Speed: The Run
Five Rendering Ideas from Battlefield 3 & Need For Speed: The Run
 

Similar to 2-D Transformations.pdf

2 d transformations by amit kumar (maimt)
2 d transformations by amit kumar (maimt)2 d transformations by amit kumar (maimt)
2 d transformations by amit kumar (maimt)Amit Kapoor
 
Computer Graphic - Transformations in 2D
Computer Graphic - Transformations in 2DComputer Graphic - Transformations in 2D
Computer Graphic - Transformations in 2D2013901097
 
2 d geometric transformations
2 d geometric transformations2 d geometric transformations
2 d geometric transformationsMohd Arif
 
2 d transformation
2 d transformation2 d transformation
2 d transformationAnkit Garg
 
3D transformation in computer graphics
3D transformation in computer graphics3D transformation in computer graphics
3D transformation in computer graphicsSHIVANI SONI
 
Two dimensionaltransformations
Two dimensionaltransformationsTwo dimensionaltransformations
Two dimensionaltransformationsNareek
 
Two dimentional transform
Two dimentional transformTwo dimentional transform
Two dimentional transformPatel Punit
 
Matrix 2 d
Matrix 2 dMatrix 2 d
Matrix 2 dxyz120
 
Three dimensional transformations
Three dimensional transformationsThree dimensional transformations
Three dimensional transformationsNareek
 
2D transformation (Computer Graphics)
2D transformation (Computer Graphics)2D transformation (Computer Graphics)
2D transformation (Computer Graphics)Timbal Mayank
 

Similar to 2-D Transformations.pdf (20)

transformation IT.ppt
transformation IT.ppttransformation IT.ppt
transformation IT.ppt
 
2 d transformations by amit kumar (maimt)
2 d transformations by amit kumar (maimt)2 d transformations by amit kumar (maimt)
2 d transformations by amit kumar (maimt)
 
Computer Graphic - Transformations in 2D
Computer Graphic - Transformations in 2DComputer Graphic - Transformations in 2D
Computer Graphic - Transformations in 2D
 
Computer Graphics - transformations in 2d
Computer Graphics - transformations in 2dComputer Graphics - transformations in 2d
Computer Graphics - transformations in 2d
 
2 d geometric transformations
2 d geometric transformations2 d geometric transformations
2 d geometric transformations
 
2 d transformation
2 d transformation2 d transformation
2 d transformation
 
3D transformation in computer graphics
3D transformation in computer graphics3D transformation in computer graphics
3D transformation in computer graphics
 
Transforms UNIt 2
Transforms UNIt 2 Transforms UNIt 2
Transforms UNIt 2
 
2d transformations
2d transformations2d transformations
2d transformations
 
Two dimensionaltransformations
Two dimensionaltransformationsTwo dimensionaltransformations
Two dimensionaltransformations
 
Two dimentional transform
Two dimentional transformTwo dimentional transform
Two dimentional transform
 
Matrix 2 d
Matrix 2 dMatrix 2 d
Matrix 2 d
 
2d transformation
2d transformation2d transformation
2d transformation
 
Quadratic equation.pptx
Quadratic equation.pptxQuadratic equation.pptx
Quadratic equation.pptx
 
3D Transformation
3D Transformation3D Transformation
3D Transformation
 
Three dimensional transformations
Three dimensional transformationsThree dimensional transformations
Three dimensional transformations
 
Computer graphics presentation
Computer graphics presentationComputer graphics presentation
Computer graphics presentation
 
2D-transformation-1.pdf
2D-transformation-1.pdf2D-transformation-1.pdf
2D-transformation-1.pdf
 
2D transformation (Computer Graphics)
2D transformation (Computer Graphics)2D transformation (Computer Graphics)
2D transformation (Computer Graphics)
 
06.Transformation.ppt
06.Transformation.ppt06.Transformation.ppt
06.Transformation.ppt
 

More from Mattupallipardhu (13)

Module 1.pptx
Module 1.pptxModule 1.pptx
Module 1.pptx
 
Image processing.pptx
Image processing.pptxImage processing.pptx
Image processing.pptx
 
Pyhton-1a-Basics.pdf
Pyhton-1a-Basics.pdfPyhton-1a-Basics.pdf
Pyhton-1a-Basics.pdf
 
Lec_2.pdf
Lec_2.pdfLec_2.pdf
Lec_2.pdf
 
Lec_10.pdf
Lec_10.pdfLec_10.pdf
Lec_10.pdf
 
Lec_4.pdf
Lec_4.pdfLec_4.pdf
Lec_4.pdf
 
Ray Tracing.pdf
Ray Tracing.pdfRay Tracing.pdf
Ray Tracing.pdf
 
Fundamentals of Computer Graphics.pdf
Fundamentals of Computer Graphics.pdfFundamentals of Computer Graphics.pdf
Fundamentals of Computer Graphics.pdf
 
raster algorithm.pdf
raster algorithm.pdfraster algorithm.pdf
raster algorithm.pdf
 
Hidden_surfaces.pdf
Hidden_surfaces.pdfHidden_surfaces.pdf
Hidden_surfaces.pdf
 
cathoderaytube.pdf
cathoderaytube.pdfcathoderaytube.pdf
cathoderaytube.pdf
 
2d Transformation.pdf
2d Transformation.pdf2d Transformation.pdf
2d Transformation.pdf
 
3. Syntax Analyzer.pptx
3. Syntax Analyzer.pptx3. Syntax Analyzer.pptx
3. Syntax Analyzer.pptx
 

Recently uploaded

INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 

Recently uploaded (20)

INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 

2-D Transformations.pdf

  • 1. 2-D Transformations • Points and lines that joins them, with appropriate drawing algorithms, represents objects/information graphically. • Ability to transform these points and lines is basic to computer graphics. • In 2-D Objects, transformation is to change the objects: - Position (Translation) - Size (Scaling) - Orientation (Rotation) - Shapes (Shear) - Reflection (Mirror image)
  • 2. Point Representation • A Point is represented in 2-Dimensions by its coordinates. • We can use a column vector (a 2x1 matrix) or row vector(1x2) to represent a 2D point : or [x y] • Row matrices or column matrices are frequently called position vectors. • Series of points, each of which is position vectors relative to some coordinate system is stored in computer as a matrix or array of numbers. • Lines are drawn between the points to generate lines, curves or pictures.
  • 3. Transformation of Points • [X][T] = [x y] [ ]= [ (ax + cy) (bx + dy)] = [x’ y’] Where, x’ = (ax + cy) and y’ = (bx + dy) Case 1: Let, a=d=1 & c=b=0. The transformation matrix [T], then reduces to the identity matrix. Thus, [X][T] = [x y] [ ]= [x y] = [x’ y’],no changes as multiplying with identity matrix gives us same result. Case 2: Let, d=1, b=c=0,then, [X][T] = [x y] [ ]= [ax y] = [x’ y’], where x’ = ax, produces a scale change in x component. a b c d 1 0 0 1 a 0 0 1
  • 4. Case 3: Let, b=c=0, i.e., [X][T] = [x y] [ ]= [ax dy] = [x’ y’], resulting in scaling of both x and y components. - If a ≠ d, means scaling are not equal. - If a = d > 1, pure enlargement/scaling of coordinates occurs. - If 0 < a = d < 1, compression of coordinates of point P occurs. a 0 0 d
  • 5. Case 4: If a and/or d are negative, then reflection through a plane or axis can be seen. Let b=c=0, d=1,a= -1, then [X][T] = [x y] [ ]= [-x y] = [x’ y’], reflection through y- axis results. - If b=c=0, a=1,d= -1,reflection through x-axis. - If b=c=0,a=d<0, reflection through origin occurs. -1 0 0 1
  • 6. Case 5: let a=d=1,c=0,thus [X][T] = [x y] [ ]= [x (bx+y)] = [x’ y’], it causes shearing effect. Here x’ is unchanged, but y’ depends on y. - if a=d=1,b=0. produces shear proportional to y coordinate. 1 b 0 1
  • 7. Straight line transformation • Position vector are: [A]=[0 1], [B]=[2 3] • Let transformation matrix, [T] = [ ],due to shearing effect. 1 2 3 1
  • 8. • Transforming the position vectors for A & B using [T] produces new vectors A’ and B’ given by: [A] [T]= [0 1] [ ] = [3 1] = [A’] , and [B] [T]= [2 3] [ ] = [11 7] = [B’] • Resulting coordinates for new point A’ are x’=3, y’=1 and B’ are x’= 11 and y’=7. • From the Fig., Shearing transformation [T] increased the length of the line and changes its orientation. 1 2 3 1 1 2 3 1
  • 10.
  • 11. Transformation of Parallel lines • If a 2x2 matrix is used to transform a pair of parallel lines, the result is a second pair of parallel lines
  • 12. Transformation of Intersecting lines • When two intersecting lines are transformed using general 2x2 transformation matrix the resulting lines are also intersecting. Consider 2 intersection lines • Points of intersection: • Transformed point of intersection:
  • 13.
  • 14. Rotation • 2D Rotation – Rotation axis – Rotation angle – rotation point or pivot point (xr,yr)
  • 15. • 2D Rotation – If θ is positive  counterclockwise rotation – If θ is negative  clockwise rotation – Remember: • cos(a + b) = cos a cos b - sin a sin b • cos(a - b) = cos a sin b + sin a cos b – At first, suppose the pivot point is at the origin – x’=r cos(θ+Φ) = r cos θ cos Φ - r sin θ sin Φ y’=r sin(θ+Φ) = r cos θ sin Φ + r sin θ cos Φ – Let, x = r cos Φ, y = r sin Φ – x’=x cos θ - y sin θ y’=x sin θ + y cos θ
  • 16. • 2D Rotation – P’=R·P, where P is the point with coordinate (x,y) and P’ is the new point with coordinate (x’,y’).             cos sin sin cos R Φ (x,y) r r θ (x’,y’)
  • 17. • 2D Rotation – Rotation of a point about any specified position (xr,yr) x’=xr+(x - xr) cos θ – (y - yr) sin θ y’=yr+(x - xr) sin θ + (y - yr) cos θ - Rotations also move objects without deformation – A line is rotated by applying the rotation formula to each of the endpoints and redrawing the line between the new end points – A polygon is rotated by applying the rotation formula to each of the vertices and redrawing the polygon using new vertex coordinates
  • 18. • 2D Inverse Rotation Matrix • And also:                  1 0 0 0 cos sin 0 sin cos 1 R I R R   * 1
  • 19. Reflection • Reflection – Image is generated relative to an axis of reflection by rotating the object 180° about the reflection axisect – Transformation that produces a mirror image of an object – Reflection about the line y=0 (the x axis) [T] =            1 0 0 0 1 0 0 0 1
  • 20. • Reflection about the line x=0 (the y axis) [T] = • Reflection about the origin [T] =           1 0 0 0 1 0 0 0 1
  • 21. • Reflection about the line y=x [T] =
  • 22. • Reflection about the line y=-x [T] =
  • 23. Scaling • 2D Scaling – Scaling is used to alter the size of an object – Simple 2D scaling is performed by multiplying object positions (x, y) by scaling factors sx and sy x’ = x · sx y’ = y · sy • or P’ = S·P                     y x s s y x y x 0 0 ' '
  • 24. • 2D Scaling – Any positive value can be used as scaling factor • Values less than 1 reduce the size of the object • Values greater than 1 enlarge the object • If scaling factor is 1 then the object stays unchanged • If sx = sy , we call it uniform scaling • If scaling factor <1, then the object moves closer to the origin and If scaling factor >1, then the object moves farther from the origin
  • 25. • 2D Scaling – We can control the location of the scaled object by choosing a position called the fixed point (xf,yf) x’ – xf = (x – xf) sx y’ – yf = (y – yf) sy x’=x · sx + xf (1 – sx) y’=y · sy + yf (1 – sy) – Polygons are scaled by applying the above formula to each vertex, then regenerating the polygon using the transformed vertices
  • 26. Composite transformation • We can setup a sequence of transformations as a composite transformation matrix by calculating the product of the individual transformations • P’=M2·M1·P =M·P • Composite 2D Translations – If two successive translation are applied to a point P, then the final transformed location P' is calculated as
  • 27. • Composite 2D rotation: • Composite 2D Scaling:
  • 28.