• Home
  • /
  • Blog
  • /
  • 3 Basic Graph Transformations For Awesome Graphics

3 Basic Graph Transformations For Awesome Graphics

Equations and Their Graphs

This post is also available in: हिन्दी (Hindi) العربية (Arabic)

Knowledge of graphs helps a lot in computer graphics. The graphs are a visual representation of functions. Many times when you know what the graph of a particular function looks like, and you want to know what the graph of a very similar function looks like. For example, if you know the graph of f(x) = x2, and want to know the graph of functions – f(x) = x2 + 3 or f(x) x2 – 5 or f(x) = (x + 1)2 or f(x) = (x – 2)2, etc. In the following text, we will look into 3 Basic Graph Transformations for awesome graphics.

3 Basic Graph Transformations
f(x) = x2
3 Basic Graph Transformations
f(x) = x2 + 3
3 Basic Graph Transformations
f(x) = x2 – 5
3 Basic Graph Transformations
f(x) = (x + 1)2
3 Basic Graph Transformations
f(x) = (x – 2)2

The graphs of all these functions have the same shape and they differ with respect to their position in the Cartesian plane. 

It means that you can plot a number of graphs quickly and easily if you know the shape of basic functions.

Graphs of Basic Functions

Following are some of the basic functions and their graphs. If you know the shape of graphs of these basic functions, you can easily plot the graphs of other related and similar functions.

3 Basic Graph Transformations
Linear function: f(x) = x
3 Basic Graph Transformations
Quadratic function: f(x) = x2
3 Basic Graph Transformations
Cubic function: f(x) = x3
3 Basic Graph Transformations
Reciprocal function: f(x) = 1/x
3 Basic Graph Transformations
Square root function: f(x) = √x
3 Basic Graph Transformations
Exponential function: f(x) = ex
3 Basic Graph Transformations
Logarithmic function: f(x) = log(x)

By applying transformations to these basic graphs, you are able to obtain new graphs that still have all the properties of the old ones. By understanding the basic graphs and the way transformations apply to them, you will recognize each new graph as a small variation in an old one, not as a completely different graph that you have never seen before. Understanding these transformations will allow you to quickly recognize and sketch a new function without having to resort to plotting points.

3 Basic Graph Transformations

There are three types of transformations through which the graphs go through when a function is changed. These transformations are:

  • Translation
  • Reflection
  • Stretching
CodingHero - 3 Basic Graph Transformations For Awesome Graphics 1 3 Basic Graph Transformations Translation Reflection Stretching 952

Translation: Translation is a process of shifting the graph of a function either left, right, up, or down. To understand how it works, let’s consider an example of basic quadratic function – f(x) = x2. The graph of f(x) = x2 is

3 Basic Graph Transformations
f(x) = x2

Translating the graph towards up: Function f(x) + a translates the graph of a function f(x) upwards by ‘a’ units. For example, f(x) = x2 + 3 will shift the graph of f(x) = x2 , 3 units upwards.

3 Basic Graph Transformations
Translated up: f(x) = x2 + 3

Translating the graph towards down: Function f(x) – a translates the graph of a function f(x) downwards by ‘a’ units. For example, f(x) = x2 – 5 will shift the graph of f(x) = x2 , 5 units downwards.

3 Basic Graph Transformations
Translated down: f(x) = x2 – 5

Translating the graph towards left: Function f(x + a) translates the graph of a function f(x) leftwards by ‘a’ units. For example, f(x) = (x + 1)2 will shift the graph of f(x) = x2 , 1 units leftwards.

Translating the graph towards right: Function f(x – a) translates the graph of a function f(x) rightwards by ‘a’ units. For example, f(x) = (x – 2)2 will shift the graph of f(x) = x2 , 2 units rightwards.

3 Basic Graph Transformations
Translated right: f(x) = (x – 2)2

Reflection

Reflection of a graph is a process of flipping the graph about one of the coordinate axes – x-axis or y-axis. To understand this, let’s consider the base function f(x) = ex.

3 Basic Graph Transformations
f(x) = ex

The first, flipping upside down (reflection about x-axis), is found by taking the negative of the original function, that is the function -f(x) flips the graph of f(x) about x-axis. For example, f(x) = -ex will flip the graph of f(x) = ex about x-axis.

3 Basic Graph Transformations
Reflection about x-axis: f(x) = -ex

The second, is flipping laterally (reflection about y-axis), is found by taking the changing x to -x, that is the function f(-x) flips the graph of f(x) about y-axis. For example, f(x) = e-x will flip the graph of f(x) = ex about y-axis.

3 Basic Graph Transformations
Reflection about y-axis: f(x) = e-x

Stretching

The stretching of a graph is of two types – vertical and horizontal. To understand this concept, let’s again consider the function f(x) = x2.

A vertical stretching is the stretching of the graph away from the x-axis. And a vertical compression (or shrinking) is the squeezing of the graph towards the x-axis. A function k.f(x) stretches the graph of the function f(x) vertically.

  • If k > 1, the graph of k.f(x) is the graph of f(x) vertically stretched by a factor k.
  • If 0 < k < 1, (a fraction), the graph of k.f(x) is the graph of f(x) vertically shrunk (or compressed) by a factor k.
3 Basic Graph Transformations
f(x) = x2

3 Basic Graph Transformations

3 Basic Graph Transformations
f(x) = (½)x2

A horizontal stretching is the stretching of the graph away from the y-axis. A horizontal compression (or shrinking) is the squeezing of the graph towards the y-axis. A function f(k.x) stretches the graph of the function f(x) horizontally.

If k > 1, the graph of f(k.x) is the graph of f(x) horizontally shrunk (or compressed) by dividing each of its x-coordinates by k.

If 0 < k < 1 (a fraction), the graph is f(x) horizontally stretched by dividing each of its x-coordinates by k.

3 Basic Graph Transformations
f(x) = x2
3 Basic Graph Transformations
f(x) = (2x)2 => f(x) = 4x2
3 Basic Graph Transformations
f(x) = (½ x)2 => f(x) = ¼ x2

Transformations of Function Graphs

-f(x)Reflect f(x) over x-axis
f(-x)Reflect f(x) over y-axis
f(x) + kShift f(x) up by k units
f(x) – kShift f(x) down by k units
f(x + k)Shift f(x) left by k units
f(x – k)Shift f(x) right by k units
k.f(x)Stretch f(x) vertically
f(k.x)Stretch f(x) hrozontally

Combination of Transformations

A function can be formed by applying two or more of the above combinations. For example again taking f(x) = x2 as a basic function, graph of f(x) = (x + 2)2 – 3 is obtained by translating graph of f(x) = x2,  2 units leftwards and the again translating the graph 3 units downwards.

3 Basic Graph Transformations
f(x) = x2
3 Basic Graph Transformations
f(x) = (x + 2)2
3 Basic Graph Transformations
f(x) = (x + 2)2 – 3

Now, let’s graph the function f(x) = x2 – 2x + 5

x2 – 2x + 5 = x2 – 2x + 1 + 4 = (x2 – 2×x×1 + 12) + 4 = (x – 1)2 + 4Therefore, graph of f(x) = x2 – 2x + 5 can be obtained by translating the graph of f(x) = x2, 1 units rightwards and 4 units upwards.

3 Basic Graph Transformations
f(x) = x2 – 2x + 5
{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
>