Game Basics Fundamental Mathematics for Games 3: Trigonometry and Linearity
Hello, everyone
This is Lee Deuk-woo from Game Mathematics
Today, we will learn about trigonometry and linearity
The term trigonometry might sound intimidating
We will focus on the essential trigonometric concepts
used in game development
We will also explore what linearity is
and expand it to discuss linear mappings and transformations
Trigonometry
Let’s first summarize the concept of trigonometry
What exactly is trigonometry?
First, the word "trigonometry"
fundamentally deals with triangles
Specifically, it refers to right-angled triangles
A right-angled triangle is
a triangle with one angle measuring exactly 90 degrees
A right-angled triangle is composed of three sides
The hypotenuse
the longest side opposite the right angle
the adjacent side (base)
and the opposite side (height)
These three sides define a right-angled triangle
We classify these as the elements of a right-angled triangle
From the three sides of a right-angled triangle
we define the ratio of two sides as trigonometric ratios
There are six possible ratios in total
However, three of these are most commonly used
The first is sin
It is the ratio of the opposite side to the hypotenuse
The second is cos
It is the ratio of the adjacent side to the hypotenuse
The third is tan
It is the ratio of the opposite side to the adjacent side
These three ratios are primarily
used in surveying and related fields
Hence, they are the most frequently applied
As we progress further
although trigonometric functions are widely used across many fields
in graphics, the sin and cos functions
are the most commonly utilized
As for the tan function
it will be explained later in the context of inverse functions
For now, don’t try to learn everything about trigonometric functions
Focus first on understanding sin and cos together
and think of them as a pair to learn initially
It’s helpful to grasp the concept of the tan function
but in practice, when using tan
we often rely on its inverse function
to calculate angles associated with vectors
Thus, our primary focus will be on these three applications
We’ll simplify and organize the content accordingly
Using any two sides of a right-angled triangle
we calculate the ratio, which is called a trigonometric ratio
We extend this trigonometric ratio into the concept of a function
This is based on the angle of the right-angled triangle
used to form the hypotenuse
where the angle between the base and hypotenuse becomes the domain
When we take the value of this ratio
the value is always between -1 and 1
Now, if we represent this in coordinates
in the Cartesian coordinate system
the value of the ratio combines the positive and negative regions
and is confined to a specific range between -1 and 1
Thus, the angle we take as the domain
is set as the domain
For the resulting values
we set the range between -1 and 1
This establishes a correspondence
This can be seen as a correspondence between two sets
Here, the domain corresponds to
all real numbers
Meanwhile, the codomain and range
are restricted to the range of -1 to 1
Thus, the domain element x
and the codomain element y
are related to the trigonometric ratio we discussed earlier
By substituting a value into the domain
we can express it as the function y = sinx
This is what we call a trigonometric function
In a way, trigonometric functions
generalize trigonometric ratios in the Cartesian coordinate system
covering all angles in the 360 degree plane
This generalized correspondence
is what we call trigonometric functions
When we use trigonometric functions
we don't limit them to right-angled triangles
but apply them to the entire plane
analyzing them based on the unit circle
A unit circle refers to a circle with a radius of 1
It specifically means a circle with a radius of 1
Now, consider a right-angled triangle
inscribed in this circle with a radius of 1
In such a case, when we look at the right-angled triangle
the hypotenuse
always corresponds to a point
on the arc of the unit circle
Thus, the value of the hypotenuse is always 1, the radius of the circle
In this setup, when we define trigonometric functions
the base divided by the hypotenuse is cos, and the height divided by the hypotenuse is sin
So, as we continuously rotate this hypotenuse vector
around one or two full rotations
we obtain the values of these curves
These are the graphs of the sin and cosine functions
These are well-known visuals, so you search online
you will be able to find theme easily
The values of these trigonometric ratios
show how they change with respect to the angle
We can observe this
While it resets after one full rotation
it essentially continues indefinitely
We can also consider rotations in the opposite direction
This means that all real-number values
can be used for rotation
To summarize these graphs
the sin and cos functions can be expressed as follows
First, as previously mentioned, sin and cos
always arewithin a range of -1 to 1
which is the consistent, repeating pattern they follow
Both functions share the same pattern
Another shared characteristic is
that their repeating patterns complete one full cycle
commonly referred to as 360 degrees
and then repeat
This repetition over 360 degrees
is also referred to as 2 pi radian
Radians and degrees
about angular measurement systems
will be explained later
Here, as a supplementary explanation
let’s clarify the 360 degree notation
Next, this is an important point
A characteristic of trigonometric functions is
imagine folding them along the y-axis
If you fold the left and right sides together
the left part of the sin function
always has the opposite sign of the right part
When mirrored this way
the two parts become vertically symmetric
The same applies to the other side
When folded, this side shifts over here
The values on the left
always take the opposite direction of the values on the right
Thus, while the values differ when folding the sine function
it exhibits a specific property
of being symmetric
about the x-axis
This can be described as its symmetry property
In contrast, the cos function is symmetric about the y axis
When folded in this manner
it perfectly mirrors itself, like a decalcomania
Therefore, for the cosine function
it is always symmetric with respect to negative inputs
which means it retains the same value
These two properties are key characteristics of sin and cos functions
and understanding them will be very useful later
Next, let's discuss the tan function
For the tan function
it does not exist at cos 90 degrees and cos 270 degrees
There are no solutions at these points
It has this peculiar characteristic
The same applies to -90 degrees and -270 degrees
Let’s explore why it doesn’t exist
First, consider the sin and cos functions
When we think about the unit circle
let’s look at the values generated by sin and cos in the unit circle
Here, the base
and the hypotenuse is such that the hypotenuse is always 1
so the base value is naturally cos theta
This base corresponds to the x value
Next, the height
is the height divided by the base, which is sin
So, for any arbitrary
angle theta, if we draw a unit circle
the region with a radius of 1
is affected by theta
Its coordinates are always
cos theta, sin theta
Then, what about the height divided by the base?
This is the tan function, and the height divided by the base
has the base value cos as x
and the height value as sin
So, it is sin theta / cos theta
However, the denominator, which is the base, corresponds to the cos function
A denominator of zero cannot exist
Therefore, at points where cos x = 0
such as 90 and 270 degrees
the tan function naturally doesn't exist
Thus, as the intervals of 90 and 270 degrees
it exhibits a pattern of having no solutions
Next, there is another crucial formula to discuss
In right-angled triangles, we have the Pythagorean theorem
Previously, we used it to find the shortest distance from the origin
Using the Pythagorean theorem
we can deduce that the square of the base plus the square of the height
equals the square of the hypotenuse
Since the hypotenuse is always fixed at 1
the square of the height results in 1
and with the base as cos and the height as sin
we arrive at cos^2 theta + sin^2 theta = 1
This relationship is always satisfied
Such an equation always holds true
You might ask, is this because it’s a unit circle?
Let’s consider the question
If we set the radius of a circle to an arbitrary value r
and if the radius of the arc is r
with r being any arbitrary value
this is essentially scaling the vector of magnitude 1
by r
It’s a scalar-based scaling of the vector
This can be viewed as scalar multiplication of a vector
Therefore, the vector with magnitude 1 always has
values of cos theta, sin theta
scaling it by r gives the scaled values
Based on this equation, the x-value becomes
r cos theta, and the y value becomes r sin theta
Now, in such a right-angled triangle
let's check if cos^2 theta + sin^2 theta = 1 still holds
Since it is based on trigonometric ratios
the base is r^2 cos ^2 theta
the height is r^2sin^2 theta
and the hypotenuse is r ^2
Dividing through by r^2, we get
cos^2 theta + sin^2 theta = 1
which regardless of the radius
we can understand that this formula is universally valid
As previously explained
for a radius r, the x value is r cos theta
and the y value is r sin theta
allowing us to decompose any point on the circle
into x and y components
One more useful point to note
In the real vector space
R^2, the standard basis vectors were (1,0) and (0,1)
These are also vectors with a magnitude of 1
If these vectors have a magnitude of 1
as mentioned earlier, they can be generalized
to represent all vectors of magnitude 1 in the plane
as cos theta, sin theta
Two specific examples are (1,0) and (0,1)
These correspond
to angles of 0 and 90 degrees
Thus, the first standard basis vector e1
is cos 0 degrees, sin 0 degrees
with values (1,0)
The second, e2, is cos 90 degrees, sin 90 degrees
corresponding to (0,1)
In this way, we’ve examined the various properties
of the sin and cos functions
Always think of the unit circle with a radius of 1
and the right-angled triangles formed within that unit circle
If you always associate them together
even if you forget the memorization of sin and cos
it won't be too difficult to recall them
Always remember trigonometric functions alongside the unit circle
Now, let’s learn about the measurement of angles
In daily life, when referring to circles
we usually use 360 degrees to describe them
However, mathematics doesn’t use degrees like this
This system is called the degree system
When we use 360 as
a reference to develop something
we may question, "Why divide by 360?"
Such questions arise
So, using the concept of a unit length of 1
how can we measure a circle?
We need a separate measurement method for this
This method is called the radian system
In the radian system
let me briefly explain how it works
First, always associate the radian system with
a unit circle with a radius of 1, cut in half
Imagine a semicircle
Think of a semicircle with a radius of 1
Then it will create a shape like this, right?
Now, let’s stretch this semicircle to the right
Stretch it by 1 unit
The end here will move to the center
This forms a semicircle
Think of it as a string, and hold it here
Now imagine pulling it straight
This creates a straight line
Then, compared to the original radius of 1
we can measure
how many times it has stretched
The arc length can be measured this way
This length corresponds to the famous
number pi, starting with 3.141592
However, as you know, it’s not an exact number
It is the irrational number pi
Thus, a multiple of approximately 3.14
gives us the arc length
So, what do we do in this case?
We reverse the process by rewinding
Place this line back to its original position
Rewind it in this manner
As we rewind, how much do we rewind?
We rewind by a length of 1
If we rewind an arc length of 1
both the arc length and the radius are 1
In such a sector
all the sides forming the sector have a length of 1
At this point, we can determine the angle
Let’s define this as the standard value
The angle corresponding to an arc length of 1
is defined as the base angle
This is the radian
As you might guess, radians
don’t result in exact values
It corresponds to approximately 52.3 degrees, which is also an irrational number
This angle is approximately 52.2958, repeating infinitely
So, how much more should we connect
to restore it to a semicircle?
Multiplying 52.2958 by approximately 3.14
or pi-times
restores it to exactly 180 degrees
Therefore, 180 degrees essentially means
multiplying the radian value corresponding to 52.3 degrees by approximately 3.14
It aligns closely with this
Thus, the result is pi radians
In the degree system we commonly use in daily life
1 degree corresponds to
pi/180 radians
as derived from the formula
1 radian, on the other hand, is the value of 180 / pi
This is how it can be understood
If this formula seems too complex
just think of it this way
even though it's an irrational number
a radian is just over 50 degrees
So, how many times smaller than 180 degrees is 53 degrees?
It’s approximately 3.14 times smaller
In other words, divide 180 by 3.14
and you’ll roughly understand the relationship
between radians and degrees without much confusion
For instance 90 degrees
is half of 180 degrees
so it is pi/2 radians
60 degrees is pi/3 radians
Since these commonly used angles are expressed in radians
frequently used values like these
should be memorized for quick recall
This will make it easier to use later
So, let’s summarize this
That’s the explanation of the radian system
Why do we learn the radian system?
Because it is widely used in mathematics and
when dealing with sin, cos, and other trigonometric functions in computers
everything is based on the radian system
However, when learning
to make things easier to understand
we sometimes use the degree system as well
While radians are the standard
if radians are used without explicitly labeling them
it’s understood to be based on the radian system
This means it uses radians as the unit
radians as the unit
If we use degrees
and degrees are used for better understanding
you will see the degree symbol
clearly marked with a circle symbol
Please understand it this way
We’ve now covered the definition of trigonometric functions, their applications, and formulas
We’ve also explored the characteristics of trigonometric functions
Additionally, we’ve reviewed the differences between degrees and radians
Let’s look at where these concepts are commonly applied
The most common application now is
when rotating an object by an angle theta
Trigonometric functions are frequently used for this
So, what does it mean to rotate an object by theta
To understand how this precess works
if you understand this mechanism
it will be very useful later when learning about matrices
and linear transformations
First, before the transformation
before the object changes or rotates
let’s assume an arbitrary element in the real vector space R2 is x,y
this x,y can be expressed as a linear combination
like this
and view it this way
At this point, if the space undergoes force
or any external factor causing transformation
then it’s not just a part of the space that transforms
but the entire space changes
However, since vector spaces are infinite
we cannot individually manipulate every single vector
in the infinite space for transformation
So how do we approach this concept?
Ultimately, all elements are constructed
from two standard basis vectors
that form the vector space
If these basis vectors change
it’s like altering the foundation of a house, changing its structure
By changing the central pillars of the vector space
you don’t have to trace every infinite element individually
but you can infer how the overall structure changes
by imagining it in your mind
This allows you to visualize the transformation
By tracking changes in the standard basis vectors
and replacing the original basis vectors
with two new basis vectors
we multiply x and y by each
and represent them as a relationship with new vectors
This allows us to understand how the space transforms
Rotation here means
that the new two basis vectors have a magnitude of 1
just like the original e1 and e2
They maintain orthogonality
with e1 and e2 being 90 degrees apart
Even their orientation
is preserved during transformation
This is called a rotational transformation
I’ll explain this in detail later
So, (1,0) rotates by an angle theta
and (0,1) also rotates by theta
In the diagram, the standard basis vector on the x-axis
e1 rotates by theta
and its coordinates become cos theta, sin theta
Then, when (0,1) rotates by theta
if we draw a right triangle here
the two triangles are similar
The height here moves to this height
However, it becomes the x-value
Here, the y-value becomes the x-value
and the x-value flips to the y-value
As you can see, it was positive here
but the x-value becomes negative here
x and y swap places
and the x value takes on
a negative value in the opposite direction
So, when (0,1) rotates by theta
its values become -sin theta, cos theta
Ultimately, this means the standard basis vector e1 becomes cos theta, sin theta
and e2 becomes -sin theta, costheta
So, by applying these transformed basis vectors
multiplying each by x and y
the original vector x, y in the initial space
is transformed into a new vector in the rotated space of theta
to determine its corresponding value
This can be done using this formula
So, a rotation by theta results in
values of x cos theta - y sin theta, x sin theta + y cos theta
These are the coordinates of the transformed vector
For now, this formula simply shows
how rotation works in spatial transformations
As of right now, it is enough just to
understand the concept
I will continue to explain this formula further
For now
this is how a rotated vector is computed
A vector rotated by theta
can be calculated as follows
I will summarize and explain it briefly this way
Finally, let’s discuss inverse functions
These are related to the previously mentioned
sin, cos, and tan functions
To invert these functions
we swap the domain and codomain, making the codomain the domain
and the original domain the codomain
This reversed relationship is called the inverse function
We might wonder if we can create such an inverse function
However, the condition for creating an inverse function
is that it must be a bijective function, as mentioned earlier
But in the case of sin and cos
they are not bijective functions
Why?
Currently, they are not one-to-one mappings
For every x
while y values range from -1 to 1
if we limit y values to -1 and 1
to make the codomain and range identical, they can be surjective
However, for x = 1
the corresponding x-values repeat infinitely
This cannot be considered one-to-one
Thus, these functions are not injective
Since they are not bijective
inverse functions cannot be created
But to make them bijective
and satisfy the property of injectivity
if we deliberately restrict the domain values
we can construct a bijective function within the restricted range
This allows us to create inverse functions
For the sin function
the non-repeating, one-to-one interval
is between -90 and 90 degrees
For the cos function, let's take the positive direction
It is between 0 and 180 degrees
Within these ranges, they satisfy bijectivity
For tan, since there’s no solution at -90 degrees
it cannot be included
So, this range is inclusive
and this one excludes the boundary
Within these excluded ranges
we can construct bijective functions
By restricting the range, we define inverse functions
as arc sin, arc cos, and arc tan
Thus, inverse functions may be denoted with a -1 superscript
or names arc sin
So, the inverse functions of these trigonometric functions
can be constructed as follows
Since these represent reversed mappings
the domain intervals previously defined now become the range in the inverse function
This applies to the codomain or range
Thus, the intervals of the range are reversed
For the range intervals, -90 to 90 degrees
both the sin and tan functions have a range of -90 to 90 degrees
Meanwhile, the cos function has a range of 0 to 180 degrees
This corresponds to a range from 0 from pi radians
This means that when we know a cos value
or any sin, cos, or tan value
we can determine the corresponding angle
so this can be a useful tool for calculations
The issue arises when finding these inverse functions
We can obtain the angles
but the values in the third and fourth quadrants
cannot be determined
These quadrant values remain unknown
This is because the bijection condition must be satisfied
Certain intervals are discarded
and the values in these quadrants are excluded
Therefore, using any trigonometric value
we cannot infer the corresponding angles in these regions
So, how can we infer these values?
We can use an extension of the arctan function
For arctan, it's defined as the ratio of the opposite side to the adjacent side
Since tan is also the ratio of height to base
when we reverse this and have the height-to-base ratio
we can determine the angle from it
Suppose the height-to-base ratio produces a positive value
There are two cases of a positive value
the base and height are
both positive
or both negative
In either case, the result is positive
So, when using tan values
to find angles in reverse
two possibilities always exist
However, due to the inverse function’s constraints
we can only retrieve values from this restricted region
But if either x or y is negative, the situation changes
If we consider the sign information
and one of the values is negative
then it must correspond
to an angle in the third quadrant
This conclusion can be drawn
Thus, when creating an inverse function
we don’t just provide the trigonometric value
but also the sign of each component
In other words, we provide both values
With this, we can cover angles in all four quadrants
We can determine the correct angles
This is precisely the two-argument version of arctan
known as the atan2 function
In most trigonometric applications
the atan2 function is frequently used
Its first argument is y
Remember this carefully
The first argument is y, and the second is x
It takes these two inputs
To determine which quadrant the angle lies in
it requires both arguments
What this means is
when calculating the ratio of height to base
to find the value of a vector
we use the ratio
of x and y
The base is x, and the height is y
When x and y are known
and these values are input into arctan
it provides the angle of rotation
relative to the origin
In other words, the angle formed by a vector
or a specific vector can be
directly obtained using the highly useful function
called atan2
Thus, atan2 is extremely handy
and versatile for angle calculations
Understanding its principles will make it even more effective
To understand why it requires two arguments
Review this video later
to deepen your understanding
Finally, let’s briefly touch upon polar coordinates
I’ll give a concise explanation
In general, we express arbitrary points in the plane of a vector space
as x,y combining their x- and y- values
Instead, let’s consider it as being composed of circles
The plane can essentially be viewed as a collection of circles
It consists of infinitely many circles
and the radius of each circle is denoted as R
We use the radius to represent them
We denote any point on the circle’s arc
with an angle theta
So, instead of expressing a vector in the plane as x, y
we use the radius of the circle
and the angle theta, which is known as the polar coordinate system
The name is polar coordinate system
The polar coordinate system is
particularly useful for representing rotational effects
Although Cartesian coordinates (x,y) are typically used
to simplify rotational calculations
we often convert temporarily
to polar coordinates
So, how do we convert from Cartesian coordinates
to polar coordinates?
As mentioned earlier, the radius
is obtained by taking the square root of x^2 + y^2
using the Pythagorean theorem
This represents the norm or magnitude of the vector
which is essentially its length
Next, when we measure the angle from 0 degrees
the angle can be determined
using the atan function, as previously explained
Input y and x into atan2
and you can immediately get the angle
Thus, Cartesian coordinates (x,y)
can be converted into polar coordinates
When polar coordinate values are given
to convert them back to Cartesian coordinates
for a radius R
and an angle theta, as explained earlier
the conversion is as follows
The x-value is r cos theta, and the y-value is r sin theta
So, if you calculate all the polar coordinate values
and want to return to Cartesian coordinates
then r cos theta corresponds to x
and r sin theta corresponds to y
This is how it works
You can apply this transformation as needed
Polar coordinates have many practical applications
For instance, this transformation here
it converts a shape originally composed of rectangles
such that as the radius increases outward from the center
it rotates more significantly
If rotated uniformly, the rectangle simply spins around
It maintains its rectangular shape while spinning
But if you want the rotation to intensify as you move outward
you can first convert to polar coordinates
As r increases
you can assign increasingly larger theta values
creating a swirling effect at the edges
This effect can be easily implemented using polar coordinates
Linearity
In mathematics, linearity
is not about the shape of a line
It refers to satisfying the following two equations
which define linearity
These are additivity and homogeneity
Additivity means that for a given mapping
if f(x+y) = f(x) + f(y)
when inputs x and y are used
and the results of f(x+y) equals f(x) + f(y)
then the function satisfies additivity
Secondly, for any scalar a
if the result of a*f(x)
equals f(ax)
the function is said to have homogeneity
If both additivity and homogeneity are satisfied
the function is considered linear
So, which mappings exhibit linearity?
or we can ask which functions can be called linear
Let’s explore which functions satisfy these properties
For example, let’s consider the function y= x
We’ll examine this function
Let’s input two values
5 and 10
with 5 and 10
x = 5 and y = 10
Then, f(5+10) = f(15)
If f(5+10) = f(5) + f(10), it satisfies additivity
Next, for any scalar a
say a = 5
and x =10
if 5*f(10) = f(50)
then the function satisfies linearity
We can say it satisfies linearity for these values
Although this doesn’t guarantee satisfaction for all values
we can rule out cases where it fails
Let’s examine which functions satisfy these properties
and which do not
for y = x, or to make it easier
we will use f(x) = x
So, for two values
5 and 10, since the output matches the input
f(15) = 15
and f(5) + f(10) = 15
Since the results are the same, it satisfies additivity
Next, 5*f(10)
equals the result for f(50)
it also satisfies homogeneity
Thus, for the inputs 5 and 10
we confirm that it satisfies linearity
Now consider y = 2x
Let's rewrite it as f(x) = 2x
You can similarly rewrite the others as f(x)
What about this function?
For an input of 15
the result is 2*15
The sum of 2*5 and 2*10 also matches
This equality follows from the distributive property
Similarly, for the second property of homogeneity
since the associative property holds for multiplication
whether you multiply 5 later or rearrange the terms
the result remains the same
Thus, the function f(x) = 2x
can be considered linear
Now, let’s examine the function f(x) = 2x + 1
If you input 15, the result is
30 + 1 = 31 on the left side
On the right side, it becomes 11 + 21 = 32
Thus, the left and right sides are not equal
Hence, it does not satisfy additivity
This means the function cannot be considered linear
We can definitively conclude this
Because we have found a counterexample
Let’s also look at y = x^2
Here too, the left and right sides are not equal
Similarly, it does not satisfy homogeneity
We can see that it fails both properties
From this, we can infer that a function of the form
y=ax, where a coefficient is attached to a first-degree term
is likely to satisfy linearity
Let’s test the function y = ax
or f(x) = ax
to see if it satisfies linearity
Here, for two arbitrary values
say scalars b and c
we need to check if f(b+c) = f(b) + f(c)
Since the distributive property holds
a*(b+c) becomes
a*b + a*c on the left side
and a*b + a*c on the right
So by the field axioms, the distributive property ensures that
we can confirm that
the left and right sides are equal
Thus, we see that it satisfies additivity
Next, for an arbitrary scalar k
let's check if k*f(b) = f(kb)
In this case, substituting b and multiplying by k
k*(ab) is the same as a*(kb)
Since multiplication satisfies the commutative and associative properties
we can confirm that
this condition is also satisfied
So, the function y = ax
can be concluded to satisfy linearity
However, when the function takes the form y=ax+b
it does not satisfy linearity, as seen earlier
Let’s verify if all functions of the form y=ax+b
fail to satisfy linearity
Here, the condition is that b is not 0
Expanding the equation
we are working with scalar fields
So, using the properties of fields
like commutative, associative, and distributive laws
we find that the two sides differ
On the left side, b appears only once
while on the right side, b appears twice
This discrepancy arises due to b
Thus, as mentioned earlier, linearity
was described as a property of lines
While ax satisfies it
ax+b does not, as we have seen
If both are linear in form
why doesn’t the second case satisfy linearity?
Linearity, in its original sense
doesn’t strictly refer to the shape of a line
It signifies that two inputs are
purely related in a first-degree proportional manner
This describes a proportional mapping
It’s not about judging by shape
but rather the relationship between two inputs and their outputs
being purely proportional in a linear relationship
It’s better to understand it as such
rather than focusing on the line
In the case of y=ax + b
the b term has no connection to the relationship between x and y
It disrupts the input-output relationship
as b is an unrelated, extraneous term
This b, like an impurity
breaks the pure linear proportionality
so it cannot satisfy linearity
Reinterpreting this
when we ask what additivity means
it can be explained as follows
Think of water and oil, which don’t mix
These two independent factors
are like two separate elements
When combined and processed through a machine
we might not know the exact result
but let’s assume it satisfies linearity
When water and oil are mixed together
and processed, there’s a resulting output
If you instead process water alone, then oil alone
you’d get separate outputs for each
Combining these separate results
should give the same result
as processing water and oil together
This means the result is purely based on water and oil
with no extraneous factors
There are no additional impurities
Now, regarding homogeneity
If the output is purely based on a combination of water and oil
then the resulting change
is not quadratic, cubic, or higher-order
like x^2, x^3, x^4
but purely proportional in a linear manner
It reflects a purely first-order proportionality
In other words, the output directly corresponds
to the input
Even if the input increases
the output increases proportionally
So, with these two properties
you can predict the outcomes
of each independent factor
By separating and analyzing them individually
then combining the results later
you can predict the final outcome
This is called the principle of superposition
When two independent patterns exist
and they satisfy linearity
even if combined in a complex way
you can handle them simply
by analyzing each separately
as the combined result will be the same
This allows for modular, step-by-step processing
You can interpret it this way
Linearity is incredibly useful
when analyzing phenomena
In graphics, linearity is extensively used
in transformations
So let’s delve into transformations
The key term you need to know for this
is linear mapping
It is linear mapping in English
Previously, linearity
referred to properties of a function f(x)
So, what’s the difference between a mapping and a function?
A function, as mentioned earlier
is a relationship between sets
A mapping is similar
It also describes relationships between sets
but within a mathematical framework
like field axioms or vector space axioms
Mappings preserve these structures
while relating sets
Based on this mapping
when we input a vector
the output
retains the original system’s properties
This is what we call a mapping
In both vector spaces and real number spaces
the system of field axioms
remain intact
From this perspective, it can be considered a mapping
Here, it can be seen as a binary operation
Both x and y are scalars
These two values, through some function
combine additively to produce a result
If scalar values are input
the structure of the field is preserved
so it can be called a mapping
If we have multiple inputs
we can adjust the number of inputs and outputs
as needed
Mapping to a vector space means
that the eight axioms of vector spaces we previously discussed
are preserved
This can also be called a mapping
Now, let’s visually explore
an example of a mapping in a vector space
In a two-dimensional vector space
let’s examine a mapping from R2 to R2
Using an input
that is a vector element of the vector space
say x, y
let’s consider how these transform into a new vector
You can construct such a function
We can imagine such a vector function
If it maps R2 to R3
using various forms of x and y
you could generate a three-dimensional vector mapping
Among these mappings
there are mappings that possess linearity, as described earlier
These will also follow a specific pattern
What is a mapping that possesses linearity?
For example, in a vector space
if the result of adding two vectors as input
equals the sum of the individual outputs
it satisfies additivity
This means if you multiply the result of inputting a vector
with a scalar
it equals the result of multiplying the scalar
with the vector before input
This is called homogeneity
To satisfy this
as mentioned earlier, linearity
means that the input-output relationship
is purely linear
In other words, aside from the input values
no extraneous factors should interfere
The relationship must remain purely linear
That’s the definition
Let’s consider this function first
When we input a vector (x,y)
it produces a two-dimensional vector as a result
Here, x is represented as x + 1
and y remains unchanged in this vector function
However, x + 1 includes
a term that is unrelated to the x and y inputs
which is 1, an extraneous factor
Thus, it will not satisfy linearity
Let’s test this by substituting values
Using two vectors (3,6) and (4,8) for x,y
if we add them
We’ll calculate the result of adding and then inputting
Next, we’ll input these two vectors separately
The results of individually inputting them
must match for additivity to hold
adding them gives (7, 14)
it results in (7, 14)
while individual inputs give (4,6) and (5,8)
Inputting (7,14) gives (8,14)
but adding the individual results gives (9,14), which are not the same
If these two matched
additivity would have been satisfied
Since the results do not match
it does not satisfy additivity
If additivity fails, there’s no need to check further
it does not satisfy linearity
Now, consider the first output as 3x + 4y
and the second output as 2x+3y
If the second element corresponds to 2x+3y
there are no extraneous terms here
There are no +1 or +2 terms
nor are there squared or higher-order terms
It’s composed of a purely linear relationship
So, what about this case?
We might think it satisfies additivity
When we substitute two vectors
the left and right sides produce the same result
indicating it satisfies linearity
Thus, for purely linear relationships
with scalars added directly
functions without extraneous terms
of the form ax+by and cx+dy
we can verify whether they always satisfy linearity
Let’s take two vectors
denote them as (x1, y1), and (x2, y2)
and proceed with this equation
When actually performing this calculation
let’s check if linearity is satisfied
According to the axioms of vector spaces
the result of adding and then inputting two vectors
is as follows
Separately inputting and then adding gives
the following form
Since the distributive property is satisfied in vector spaces
the scalar-vector distributive property holds
Thus, these terms are equal
Hence, it satisfies additivity
Next, consider an arbitrary scalar k
Let’s check if it satisfies homogeneity
Similarly, using the axioms of vector spaces
we can confirm that this property is satisfied
Therefore, in any two-dimensional vector space
a mapping from a 2D vector space to another 2D vector space
like f(x,y) = (ax+by, cx+dy)
can be concluded to satisfy linearity
Thus, as mentioned earlier, linear mappings
are the relationships between two structures or systems
that preserve linearity
If limited to vector spaces
it gives the impression of space transformation
More specifically, we use the term linear transformation
to describe it
If linear mapping is the term used
then the term linear transformation
is used for practical applications in vector spaces
In fact, linear functions, mappings, and transformations
can be considered to mean the same thing
Which term should we use among these three?
For vector spaces
using the term linear transformation
conveys the meaning more clearly
Therefore, in vector spaces
linear mappings are also referred to as linear transformations
From now on, we will refer to such relationships
as linear transformations
Linear transformations in the 2D real vector space
will have the following form
Based on this, in the next session
we will explore how to perform linear transformations
and learn their methods
This concludes today’s lecture
Thank you for attending the lesson
Thank you
Trigonometric Functions Trig Ratios: The ratio of 2 sides among 3 sides of a right triangle Trig Functions: generalized relationship of trig ratios
Angle Measurement Degree System: Represents angles using 360, a number with many divisors Radian System: Defines basic angle where the arc length is 1
Trigonometry in Computer Graphics: Operates based on radians Vector Rotation: Requires understanding the mechanism of rotating an object by theta
Rotation Transformation: Transforms two basis vectors while preserving their magnitude of 1, orthogonality, and current orientation
Trigonometric Functions Inverse Trigonometric Functions Since sin and cos are not bijective, their domains are restricted to create inverse functions
Can obtain the value of the angle formed by an arbitrary vector by using the arctan function Polar Coordinates Used instead of Cartesian coordinates for easier rotation handeling
Polar Coordinates: Represent positions using a circle's radius and the angle formed by the arc
Linearity Achieved if a function satisfies both additivity and homogeneity of degree 1 Additivity:f(x+y)=f(x)+f(y) Homogeneity of degree 1:af(x)=f(ax)
Additivity: result of combining 2 independent elements is same as processing separately and adding Homogeneity: pure linear proportional relationship
Linear mapping Mapping: a relation that corresponds to each other while preserving the mathematical system A linearity mapping preserves the system when a vector is applied to it
Linear Mapping: A correspondence between two structures with linearity Linear Transformation: A correspondence within a practical vector space