NOTES-M5- CS-Application of Physics in Computing
NOTES-M5- CS-Application of Physics in Computing
Animation
Animation is a method of photographing successive drawings, models, or even puppets,
to create an illusion of movement in a sequence. Because our eyes can only retain an image for
approx. 1/10th of a second, when multiple images appear in fast succession, the brain blends
them into a single moving image. Therefore, animation is a technique or the process of
displaying still images in a rapid sequence to create the illusion of movement.
The Taxonomy of Physics-Based Animation Methods
At the highest level, the field of physics-based animation and simulation can roughly be
subdivided into two large groups:
1. Kinematics is the study of motion without consideration of mass or forces.
2. Dynamics is the study of motion taking mass and forces into consideration.
Kinematics and dynamics come in two flavors or subgroups:
1. Inverse is the study of motion knowing the starting and ending points.
2. Forward is the study of motion solely given the starting point.
Frames and Frames Per Second (FPS)
A frame is a single image in a sequence of pictures. A frame contains the image to be
displayed at a unique time in the animation. In general, one second of a video is comprised of 24
or 30 frames per second also known as FPS. The frame is a combination of the image and the
time of the image when exposed to the view. An extract of frames in a row makes the animation.
Frames per second commonly called as FPS refers to the number of images we see in
every second of an animated sequence or movie. If the fps is set too low, the animation will look
choppy, as though the individual frames are being shown to us one by one. An animation shot
on film and projected is played at 24 frames per second. So if an animated video is played back
at 24fps that means each second of video shows 24 distinct still images. The speed at which they
are shown tricks your brain into perceiving smooth motion. Animation for television in Europe,
Africa, the Middle East and Australia is played at 25 frames per second. An animated film with
25 frames per second is played on television, at 24 frames per second would result in a black bar
rolling up the screen. Then digital converts are to be used to transfer one speed of film to another
speed of video. The most important thing to find out when animating something is what speed
the animation will be played back at.
If we double the size of the cube along each dimension, its height increases by 2 times,
the surface area increases by 4 times, and its volume increases by 8 times. While the area
increases by squares as we scale the object, the volume changes by cubes.
Weight and strength
Strength is the maximum force a muscle or group of muscles can apply against a
resistance in a push, pull or lift motion. Body weight is proportional to volume. The abilities of
our muscles and bones, however, increase by area because their abilities depend more on cross-
sectional area than volume. To increase a muscle or bone’s strength, we need to increase its
cross- sectional area.
Example: Let us look at an example of a somewhat average human man. At 6 feet tall, he
weighs 80kgs and can lift around 40-50kgs. In other words, he can lift half his body weight. If
you scale up the body size by a factor of 2, the weight increases by a factor of 8. Such a character
could then lift more weight. But since he weighs more than 8 times more than he did before, he
cannot lift his arms and legs as easily as a normal man. Such a giant gains strength, but loses
agility (ability to move quickly and easily).
Motion and Timing in animations
Motion and timing go hand in hand in animation. Motion is an essential component in
games and animations. The motion is governed by the Newton’s laws and kinematic equations.
When animating a scene, there are several types of motion to consider.
These are the most common types of motion
1. Linear
2. Parabolic
3. Circular
4. Wave
Motion Lines and Paths
Individual drawings or poses have a line of action, which indicates the visual flow of
action at that single image. Motion has a path of action, which indicates the path along which the
object or character moves. The path of action refers to the object’s motion in space. While it can
help show timing, its primary function is to see the direction and path of the motion, and not
necessarily its timing.
Acceleration Timing
Timing for acceleration can be calculated very accurately when the net force being
exerted is constant. Let’s take a look at the forces and how they can be used to calculate the
animation’s timing.
Constant Forces
A constant force is a force that doesn’t vary over time. Examples of constant forces include:
1. Gravity pulling an object to the ground
2. Friction bringing an object to a stop
The Odd Rule is a multiplying system based on the smallest distance traveled between
two frames in the sequence. For a slow-out, this is the distance between the first two frames; for
a slow-in, it’s the distance between the last two frames. This distance, the base distance, is used
in all Odd Rule calculations.
Odd Rule Multipliers
The Odd Rule in its simplest form, as described above, is just one way to use it. For example,
one can instead calculate the distance from the first frame to the current frame and use these
distances to place the object on specific frames. Calculating the distance for a large number of
frames and a chart like this isn’t practical, one can figure out the odd number multiplier for
consecutive frames with this formula:
Odd number multiplier for consecutive frames = ((frame # – 1) * 2) – 1
One of the benefits of the Odd Rule is one can calculate the total distance traveled from the start
point to the current frame with the following formula:
Multiplier for distance from first frame to current frame = (Current Frame# − 1)2
When setting the keys, one can use either the consecutive key multipliers or total distance
multipliers but need to choose the one that’s easiest to use for the animated sequence.
Odd Rule Scenarios
Here are a few different scenarios for calculating the distance an object travels between keys in a
slow-in or slow-out.
Base Distance Known Speeding up
If the object is speeding up, the first frame distance is the base distance. If one knows the
base distance, figuring out the distance the object travels at each frame is pretty straightforward.
Just multiply the base distance by 3, 5, 7, etc. to get the distances between consecutive frames, or
use squares to multiply the base distance to get the total distance traveled on each frame.
Suppose there is a jump push (take off) with constant acceleration over 5 frames, and the total
distance traveled is 0.4m. Using the formula above, we find the base distance.
One feature of the Odd Rule is that the base distance is always half the difference between any two adjacent distances.
To find the base distance, one can simply calculate:
(0.5m – 0.35m)/2 = 0.07m
To figure out how many frames are in the slow-in, divide the first distance by the base distance to find out which odd
number it corresponds to.
0.5/0.07 = 7
This means the first distance corresponds to 7 in the 7, 5, 3, 1 sequence, making the sequence four frames long. Now ibe
can work back the other way, multiplying the base distance by odd numbers to get the distances for the rest of the slow-
in frames.
Motion Graphs
A motion graph plots an object’s position against time. If one is using animation software, understanding and using
motion graphs is a key skill in animating anything beyond the simplest of motions. If one is drawing the animation,
drawing motion graphs before animating can help one to visualize the motion. On a motion graph, the time goes from
left to right across the bottom of the graph, while the object’s position is plotted vertically against the time. Each axis in
3D space (X, Y, Z) has its own line showing the object’s position along that axis. At the very least, one will need to
understand the types of lines in a motion graph and what they represent in terms of visible motion. one can also look at
motion graphs to get a better understanding of any difficulties one is having
with the timing or action.
Parts of Jump
A jump can be divided into several distinct parts:
Crouch—A squatting pose taken as preparation for jumping.
Takeoff—Character pushes up fast and straightens legs with feet still on the ground. The distance from the
character’s center of gravity (CG) in the crouch to the CG when the character’s feet are just about to leave the
ground is called the push height. The amount of time (or number of frames) needed for the push is called the
push time.
In the air—Both the character’s feet are off the ground, and the character’s center of gravity (CG) moves in a
parabolic arc as any free-falling body would. First it reaches an apex, and then falls back to the ground at the
same rate at which it rose. The height to which the character jumps, called the jump height, is measured from
the CG at takeoff to the CG at the apex of the jump. The amount of time the character is in the air from takeoff
to apex is called the jump time. If the takeoff pose and the landing pose are similar, then the jump height and
jump time are about the same going up as they are going down.
Landing—Character touches the ground and bends knees to return to a crouch. The distance from the
character’s CG when her feet hit to the ground to the point where the character stops crouching is called the
stop height. The stop height is not always exactly the same as the push height.
Jump Magnification
When calculating the remainder of the timing for the entire jump action, you can use a factor called jump magnification
(JM). The JM can be used to calculate the push timing and stop timing.
The JM is the ratio of the jump height to the push height.
Jump Height
JM =
Push Height
Since you already know the jump height and push height, you can calculate the JM. Then you can use the JM to
calculate other aspects of the jump.
Example:
Jump Height = 1m
Push Height = 0.33m
JM = Jump Height/Push Height = 3
To see how this works, let’s look at the formula for JM and relate it to acceleration:
Jump Time Jump Height
JumpTime Jump Height Push Acceleration
JM = = =
PushTime Push Height Jump Acceleration
The magnitude of jump acceleration is always equal to gravitational acceleration, with deceleration as the character
rises and acceleration as it falls.
Look, it’s the JM! And it’s equal to the ratio of the push acceleration to gravity. Increase your jump time, and the push
acceleration goes up. Decrease your push time, and the push acceleration goes up. Distance (or in this case, jump or
push height) is also related to velocity: Distance = Average Velocity * Time
Physics shorthand:
d = vt
With some algebra, we make this into yet another formula for the average
velocity:
v = d/t
Because the average velocity is the same for both the push and jump, we can say that d/t is the same for both jump and
push:
Jump Height/Jump Time = Push Height/Push Time
And with a little more algebra:
Jump Height Push Height
=
PushTime PushTime
Push Time
The JM also gives you the ratio of the jump time to the push time.
JM = Jump Time/Push Time
Working a little algebra, we can express the equation in a way that directly calculates the push time:
Push Time = Jump Time/JM
Example:
JM = 3
Jump Time: 15 frames
Push Time = 15/3 = 5 frames
Landing
The forces on landing are similar to takeoff. If the landing has faster timing, the forces will be larger than for a longer
timing.
Stop Time
The stop height is often a bit larger than the push height, but the timing ofthe push and stop are the same in the sense
that the CG moves the same distance per frame in the push and stop. If the stop height is larger than the push height,
you’ll just need more frames for the stop than the push.
Using algebra, we can get the following equation for stop time:
Stop Time = (Push Time * Stop Distance)/Push Height
Example:
Push Time: 5 frames
Push Height: 0.4m
Stop Height: 0.5m
Stop Time = (5 * 0.5) / 0.4 = 6 frames
Walking
Walks feature all the basics of mechanics while including personality. The ability to animate walk cycles is one of the
most important skills a character animator needs to master.
Walk Timing
Walk Timing
Walking is sometimes called “controlled falling.” Right after you move past the passing position,
your body’s center of gravity is no longer over your base of support, and you begin to tip. Your
passing leg moves forward to stop the fall, creating your next step. Then the cycle begins again.
The horizontal timing for between the four walk poses is not uniform. The CG slows in going
from the contact to passing position, then slows out from passing to contact. The CG also rises
and falls, rising to the highest position during passing and the lowest during contact. The head is
in the highest position during passing.
********************
Chapter-2
Statistical Physics
Statistical physics is the study of special laws that govern the behavior and properties of
macroscopic bodies
Descriptive statistics and inferential statistics
Statistical techniques can be categorized as descriptive statistics and inferential statistics
The process of organizing and describing the known data using charts, bar graphs, etc., is
known as descriptive statistics. It mainly focuses on describing the visible characteristics of a
database. It enables researchers to present data in a more meaningful way such that easy
interpretations can be made.
The process of making predictions or inferences (conclusions) and generalizations about the data
is known as inferential statistics. When the data is very large it becomes difficult to use it. In
such cases, certain samples are taken as representative of the entire population. Inferential
statistics draws conclusions using these samples. Both descriptive and inferential statistics need
to be used hand in hand so as to analyze the data in the best possible way.
λ k e−λ
f (k ; λ )=P ( X=k )=
k!
Here k is the number of occurrences, e is Euler’s Number, ! is the factorial function. The positive real number λ is equal
to the expected vlaue of X and also to its Variance. The Poisson distribution may be used in the design of experiments
such as scattering experiments where a small number of events are seen.
Because the average event rate is one overflow flood per 100 years, λ = 1
λ k e−λ
f (k ; λ )=P ( X=k )=
k!
λk e−λ 1k e−1
P(k overflow floods in 100 years) = =
k! k!
The experimental search for Proton Decay was undertaken because of the implications of the Grand unification
Theories. The lower bound for the lifetime is now projected to be on the order of τ = 10 33 Years. The probability for
observing a proton decay can be estimated from the nature of particle decay and the application of Poisson Statistics.
The number of protons N can be modeled by the decay equation
N=N 0 e−λ t
Here λ = 1/t= 10-33/ year is the probability that any given proton will decay in a year. Since the decay constant λ is so
small, the exponential can be represented by the first two terms of the Exponential Series.
−λ t
e =1−λ t , thus N≈ N 0 (1− λ t )
For a small sample, the observation of a proton decay is infinitesmal, but suppose we consider the volume of protons
represented by the Super Kameokande neutrino detector in Japan. The number of protons in the detector volume is
reported by Ed Kearns of Boston University to be 7.5 x 10 33protons. For one year of observation, the number of
expected proton decays is then
33 −33
N−N 0=N 0 λ t=(7.5×10 protons)( 10 / year)( 1 year )=7.5
About 40% of the area around the detector tank is covered by photo-detector tubes, and if we take that to be the nominal
efficiency of detection, we expect about three observations of proton decay events per year based on a 10 33year lifetime.
So far, no convincing proton decay events have been seen. Poisson statistics provides a convenient means for assessing
the implications of the absence of these observations. If we presume that λ = 3 observed decays per year is the mean,
then the Poisson distribution function tells us that the probability for zero observations of a decay is
λ k e− λ 30 e −3
(
pk=) (
pk=) =0.05
k! 0!
This low probability for a null result suggests that the proposed lifetime of 10 33 years is too short. While this is not a
realistic assessment of the probability of observations because there are a number of possible pathways for decay, it
serves to illustrate in principle how even a non-observation can be used to refine a proposed lifetime.
A bell curve is a common type of distribution for a variable, also known as the normal distribution. The term "bell
curve" originates from the fact that the graph used to depict a Normal Distribution consists of a symmetrical bell-shaped
curve.
The highest point on the curve, or the top of the bell, represents the most probable event in a series of data (its Mean,
Mode and Median in this case), while all other possible occurrences are symmetrically distributed around the mean,
creating a downward-sloping curve on each side of the peak. The width of the bell curve is described by its Standard
Deviation.
The term "bell curve" is used to describe a graphical depiction of a normal probability distribution, whose underlying
standard deviations from the mean create the curved bell shape. A standard deviation is a measurement used to quantify
the variability of data dispersion, in a set of given values around the mean. The mean, in turn, refers to the average of all
data points in the data set or sequence and will be found at the highest point on the bell curve.
Standard Deviations
The Standard Deviation is a measure of how spread out
numbers are. 68% of values are within 1 standard
deviation of the mean. 95% of values are within 2
standard deviations of the mean. 99.7%of values are
within 3 standard deviations of the mean
Monte-Carlo Method
Monte Carlo method applied to approximating the value of π. For example, consider a quadrant inscribed in a unit
square. Given that the ratio of their areas is π/ 4 , the value of π /can be approximated using a Monte Carlo method:
In this procedure the domain of inputs is the square that circumscribes the quadrant. We generate random inputs by
scattering grains over the square then perform a computation on each input (test whether it falls within the quadrant).
Aggregating the results yields our final result, the approximation of π.
There are two important considerations:
1. If the points are not uniformly distributed, then the approximation will be poor.
2. There are many points. The approximation is generally poor if only a few points are randomly placed in the
whole square. On average, the approximation improves as more points are placed.
Uses of Monte Carlo methods require large amounts of random numbers, and their use benefited greatly from Pseudo
random number generators, which were far quicker to use than the tables of random numbers that had been previously
used for statistical sampling.