This document discusses algorithms for rendering lines and circles on a pixel-based display from vector representations. It begins by explaining the need to convert from continuous to discrete space. It then covers the scan conversion of lines using approaches like the digital differential analyzer algorithm and Bresenham's line algorithm. For circles, it discusses solving the circle equation but notes inefficiencies. It introduces the mid-point circle algorithm which uses the symmetry of circles and only calculates pixels in one eighth by evaluating the circle function at midpoints.
Do Not just learn computer graphics an close your computer tab and go away..
APPLY them in real business,
Visit Daroko blog for real IT skills applications,androind, Computer graphics,Networking,Programming,IT jobs Types, IT news and applications,blogging,Builing a website, IT companies and how you can form yours, Technology news and very many More IT related subject.
-simply google:Daroko blog(professionalbloggertricks.com)
• Daroko blog (www.professionalbloggertricks.com)
• Presentation by Daroko blog, to see More tutorials more than this one here, Daroko blog has all tutorials related with IT course, simply visit the site by simply Entering the phrase Daroko blog (www.professionalbloggertricks.com) to search engines such as Google or yahoo!, learn some Blogging, affiliate marketing ,and ways of making Money with the computer graphic Applications(it is useless to learn all these tutorials when you can apply them as a student you know),also learn where you can apply all IT skills in a real Business Environment after learning Graphics another computer realate courses.ly
• Be practically real, not just academic reader
Do Not just learn computer graphics an close your computer tab and go away..
APPLY them in real business,
Visit Daroko blog for real IT skills applications,androind, Computer graphics,Networking,Programming,IT jobs Types, IT news and applications,blogging,Builing a website, IT companies and how you can form yours, Technology news and very many More IT related subject.
-simply google:Daroko blog(professionalbloggertricks.com)
• Daroko blog (www.professionalbloggertricks.com)
• Presentation by Daroko blog, to see More tutorials more than this one here, Daroko blog has all tutorials related with IT course, simply visit the site by simply Entering the phrase Daroko blog (www.professionalbloggertricks.com) to search engines such as Google or yahoo!, learn some Blogging, affiliate marketing ,and ways of making Money with the computer graphic Applications(it is useless to learn all these tutorials when you can apply them as a student you know),also learn where you can apply all IT skills in a real Business Environment after learning Graphics another computer realate courses.ly
• Be practically real, not just academic reader
This slide contain description about the line, circle and ellipse drawing algorithm in computer graphics. It also deals with the filled area primitive.
Mathematics (from Greek μάθημα máthēma, “knowledge, study, learning”) is the study of topics such as quantity (numbers), structure, space, and change. There is a range of views among mathematicians and philosophers as to the exact scope and definition of mathematics
Notes for Mechanical and Computer science Students,
In the Notes Including the Basic to algo and transformation in Computer grafics Pixels, it is a important topic
Most modern devices are made from billions of on /off switches called transistors
We will build a processor in this course!
Transistors made from semiconductor materials:
MOSFET – Metal Oxide Semiconductor Field Effect Transistor
NMOS, PMOS – Negative MOS and Positive MOS
CMOS – Complimentary MOS made from PMOS and NMOS transistors
Transistors used to make logic gates and logic circuits
We can now implement any logic circuit
Can do it efficiently, using Karnaugh maps to find the minimal terms required
Can use either NAND or NOR gates to implement the logic circuit
Can use P- and N-transistors to implement NAND or NOR gates
This slide contain description about the line, circle and ellipse drawing algorithm in computer graphics. It also deals with the filled area primitive.
Mathematics (from Greek μάθημα máthēma, “knowledge, study, learning”) is the study of topics such as quantity (numbers), structure, space, and change. There is a range of views among mathematicians and philosophers as to the exact scope and definition of mathematics
Notes for Mechanical and Computer science Students,
In the Notes Including the Basic to algo and transformation in Computer grafics Pixels, it is a important topic
Most modern devices are made from billions of on /off switches called transistors
We will build a processor in this course!
Transistors made from semiconductor materials:
MOSFET – Metal Oxide Semiconductor Field Effect Transistor
NMOS, PMOS – Negative MOS and Positive MOS
CMOS – Complimentary MOS made from PMOS and NMOS transistors
Transistors used to make logic gates and logic circuits
We can now implement any logic circuit
Can do it efficiently, using Karnaugh maps to find the minimal terms required
Can use either NAND or NOR gates to implement the logic circuit
Can use P- and N-transistors to implement NAND or NOR gates
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
Honest Reviews of Tim Han LMA Course Program.pptxtimhan337
Personal development courses are widely available today, with each one promising life-changing outcomes. Tim Han’s Life Mastery Achievers (LMA) Course has drawn a lot of interest. In addition to offering my frank assessment of Success Insider’s LMA Course, this piece examines the course’s effects via a variety of Tim Han LMA course reviews and Success Insider comments.
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
1. Rendering – 1
(Scan Conversion of Line and Circle)
Lenin Laitonjam
NIT Mizoram
Computer Grapics - CSL 1603
2. Rendering
• To draw something on the screen, we need to consider
pixel grid
• Discreet space
• We need to map the representations from continuous to
discreet space
• The mapping process is called rendering
• Also called scan conversion/rasterization
• We will have a look at scan conversion of
• Point
• Line
• Circle
Rendering
Computer Grapics - CSL 1603
3. Point Scan Conversion
•Trivial: simply round off to the nearest pixel
position
The point can be mapped to
any of the four pixel
positions, depending on the
coordinate value
e.g. (1.1, 2.6) maps to (1, 3)
Rendering
Computer Grapics - CSL 1603
4. Line Scan Conversion
• A line segment is defined by the coordinate
positions of the line end-points
• What happens when we try to draw this on a
pixel based display?
• How to choose the correct pixels
Rendering
Computer Grapics - CSL 1603
5. Line Equation
• Slope-intercept line
equation
where
x
y
y0
yend
xend
x0
b
x
m
y
0
0
x
x
y
y
m
end
end
0
0 x
m
y
b
Rendering
Computer Grapics - CSL 1603
6. A Very Simple Solution
• Simply work out the corresponding y coordinate
for each unit x coordinate
• Let’s consider the following example
x
y
(2, 2)
(7, 5)
2 7
2
5
Rendering
Computer Grapics - CSL 1603
7. A Very Simple Solution
• First work out m and b:
5
3
2
7
2
5
m
5
4
2
5
3
2
b
Now for each x value work out the y value
5
3
2
5
4
3
5
3
)
3
(
y 5
1
3
5
4
4
5
3
)
4
(
y
5
4
3
5
4
5
5
3
)
5
(
y 5
2
4
5
4
6
5
3
)
6
(
y
Rendering
Computer Grapics - CSL 1603
8. A Very Simple Solution
• Now just round off the results and turn on these
pixels to draw our line
3
5
3
2
)
3
(
y
3
5
1
3
)
4
(
y
4
5
4
3
)
5
(
y
4
5
2
4
)
6
(
y
Rendering
Computer Grapics - CSL 1603
9. A Very Simple Solution
• However, this approach is just way too slow
• In particular,
• The equation y = mx + b requires the
multiplication of m by x
• Rounding off the resulting y coordinates
• We need a faster solution
Rendering
Computer Grapics - CSL 1603
10. A Quick Note About Slopes
• In the previous example, we chose to solve the
line equation to get y coordinate for each x
coordinate
• What if we had done it the other way around?
• So this gives us:
where: and
m
b
y
x
0
0
x
x
y
y
m
end
end
0
0 x
m
y
b
Rendering
Computer Grapics - CSL 1603
11. A Quick Note About Slopes
• Leaving out the details this gives us:
• We can see easily that this line doesn’t look very
good!
• We choose which way to work out the line pixels
based on the slope of the line
• If the slope of a line is between -1 and 1, work out y
coordinates based on x coordinates
• Otherwise do the opposite – x coordinates are computed
based on y coordinates
4
3
2
3
)
3
(
x 5
3
1
5
)
4
(
x
Rendering
Computer Grapics - CSL 1603
12. The DDAAlgorithm
• The digital differential analyzer (DDA)
algorithm takes an incremental approach in order
to speed up scan conversion
• Consider the list of points that we determined for
the line in our previous example:
(2, 2), (3, 23/5), (4, 31/5), (5, 34/5), (6, 42/5), (7, 5)
• Notice that as the x coordinates go up by one, the
y coordinates simply go up by the slope of the line
• This is the key insight in the DDA algorithm
Rendering
Computer Grapics - CSL 1603
13. The DDAAlgorithm
• When m is between -1 and 1, begin at the first
point in the line and, by incrementing x by 1,
calculate the corresponding y as follows
• When m is outside these limits, increment y by 1
and calculate the corresponding x as follows
m
y
y k
k
1
m
x
x k
k
1
1
Rendering
Computer Grapics - CSL 1603
14. The DDAAlgorithm
• Again the values calculated by the equations
used by the DDA algorithm must be rounded
Rendering
Computer Grapics - CSL 1603
15. The DDAAlgorithm Summary
• The DDA algorithm is much faster than our
previous attempt
• In particular, there are no longer any
multiplications involved
• However, there are still two big issues
• Accumulation of round-off errors can make the
pixelated line drift away from what was intended
• The rounding operations and floating point
arithmetic involved are time-consuming
Rendering
Computer Grapics - CSL 1603
16. The Bresenham Line Algorithm
• Move across the x axis in unit intervals and
at each step choose between two different y
coordinates
Rendering
Computer Grapics - CSL 1603
17. • The y coordinate on the mathematical line at
xk+1 is:
Derivation
• At sample position xk+1 the vertical
separations from the mathematical line are
labelled dupper and dlower
b
x
m
y k
)
1
(
Rendering
Computer Grapics - CSL 1603
18. Derivation
• So, dupper and dlower are given as follows:
and
• We can use these to make a simple decision
about which pixel is closer to the mathematical
line
k
lower y
y
d
k
k y
b
x
m
)
1
(
y
y
d k
upper
)
1
(
b
x
m
y k
k
)
1
(
1
Rendering
Computer Grapics - CSL 1603
19. Derivation
•This simple decision is based on the difference
between the two pixel positions:
• Let’s substitute m with ∆y/∆x where ∆x and ∆y
are the differences between the end-points:
1
2
2
)
1
(
2
b
y
x
m
d
d k
k
upper
lower
)
1
2
2
)
1
(
2
(
)
(
b
y
x
x
y
x
d
d
x k
k
upper
lower
)
1
2
(
2
2
2
b
x
y
y
x
x
y k
k
c
y
x
x
y k
k
2
2
Rendering
Computer Grapics - CSL 1603
20. Derivation
• So, a decision parameter pk for the kth step
along a line is given by:
• The sign of the decision parameter pk is the
same as that of dlower – dupper
• If pk is negative, then choose the lower pixel,
otherwise choose the upper pixel
c
y
x
x
y
d
d
x
p
k
k
upper
lower
k
2
2
)
(
Rendering
Computer Grapics - CSL 1603
21. Derivation
• Remember coordinate changes occur along the x
axis in unit steps, so we can do everything with
integer calculations
• At step k+1 the decision parameter is given as:
•Subtracting pk from this we get:
c
y
x
x
y
p k
k
k
1
1
1 2
2
)
(
2
)
(
2 1
1
1 k
k
k
k
k
k y
y
x
x
x
y
p
p
Rendering
Computer Grapics - CSL 1603
22. Derivation
• But, xk+1 is the same as xk+1 so:
•where yk+1 - yk is either 0 or 1 depending on the
sign of pk
• The first decision parameter p0, evaluated at
(x0, y0), is given as:
)
(
2
2 1
1 k
k
k
k y
y
x
y
p
p
x
y
p
2
0
Rendering
Computer Grapics - CSL 1603
23. The Bresenham Line Algorithm
1. Input the two line end-points, storing the left end-point
in (x0, y0)
2. Plot the point (x0, y0)
3. Calculate the constants Δx, Δy, 2Δy, and (2Δy - 2Δx) and
get the first value for the decision parameter as:
4. At each xk along the line, starting at k = 0, perform the
following test. If p < 0, the next point to plot is
(xk+1, yk) and:
x
y
p
2
y
p
p
2
Rendering
Computer Grapics - CSL 1603
24. The Bresenham Line Algorithm
• The algorithm and derivation above assumes
slopes are less than 1 (|m| < 1.0), for other slopes
we need to adjust the algorithm slightly
Otherwise, the next point to plot is (xk+1, yk+1) and:
5. Repeat step 4 until x < (x2-1)
x
y
p
p
2
2
Rendering
Computer Grapics - CSL 1603
25. Circle Scan Conversion
• The equation for a circle is:
where r is the radius of the circle
• So, we can write a simple circle drawing
algorithm by solving the equation for y at unit x
intervals using:
2
2
2
r
y
x
2
2
x
r
y
Rendering
Computer Grapics - CSL 1603
26. Circle Scan Conversion
• Unsurprisingly this is not a brilliant solution
• Firstly, the resulting circle has large gaps where
the slope approaches the vertical
• Secondly, the calculations are not very efficient
• The square (multiply) operations
• The square root operation – try really hard to avoid
these!
• We need a more efficient, more accurate solution
Rendering
Computer Grapics - CSL 1603
27. Eight-Way Symmetry
• Circles centred at (0, 0) have eight-way symmetry
– this fact can be exploited to design an efficient
algorithm
Rendering
Computer Grapics - CSL 1603
28. Mid-Point Circle Algorithm
• An incremental algorithm for drawing circles
• Algorithm calculates pixels only for the top
right eighth of the circle
• Other points are derived using the eight-way
symmetry
Rendering
Computer Grapics - CSL 1603
29. Mid-Point Circle Algorithm
• Assume that we have
just plotted point (xk, yk)
•The next point is a
choice between (xk+1, yk)
and (xk+1, yk-1)
•We would like to choose
the point that is nearest to
the actual circle
• So how do we make this
choice?
Rendering
Computer Grapics - CSL 1603
30. Mid-Point Circle Algorithm
• Let’s re-jig the equation of the circle slightly to
give us:
• The equation evaluates as follows:
• By evaluating this function at the midpoint
between the candidate pixels we can make our
decision
2
2
2
)
,
( r
y
x
y
x
fcirc
,
0
,
0
,
0
)
,
( y
x
f circ
boundary
circle
the
inside
is
y)
(x,
if
boundary
circle
on the
is
)
,
(
if y
x
boundary
circle
the
outside
is
)
,
(
if y
x
Rendering
Computer Grapics - CSL 1603
31. Mid-Point Circle Algorithm
• Assuming we have just plotted the pixel at (xk,yk) so
we need to choose between (xk+1,yk) and (xk+1,yk-1)
• Our decision variable can be defined as:
•If pk < 0 the midpoint is inside the circle and the pixel
at yk is closer to the circle
• Otherwise the midpoint is outside and yk-1 is closer
2
2
2
)
2
1
(
)
1
(
)
2
1
,
1
(
r
y
x
y
x
f
p
k
k
k
k
circ
k
Rendering
Computer Grapics - CSL 1603
32. Mid-Point Circle Algorithm
• To ensure things are as efficient as possible we
can do all of our calculations incrementally
• First consider:
or
where yk+1 is either yk or yk-1 depending on the
sign of pk
2
2
1
2
1
1
1
2
1
]
1
)
1
[(
2
1
,
1
r
y
x
y
x
f
p
k
k
k
k
circ
k
1
)
(
)
(
)
1
(
2 1
2
2
1
1
k
k
k
k
k
k
k y
y
y
y
x
p
p
Rendering
Computer Grapics - CSL 1603
33. Mid-Point Circle Algorithm
• The first decision variable is given as
• Then if pk < 0 then the next decision variable is
given as:
• If pk > 0 then the decision variable is
r
r
r
r
f
p circ
4
5
)
2
1
(
1
)
2
1
,
1
(
2
2
0
1
2 1
1
k
k
k x
p
p
1
2
1
2 1
1
k
k
k
k y
x
p
p
Rendering
Computer Grapics - CSL 1603
34. Mid-Point Circle Algorithm
• Input radius r and circle centre (xc, yc), then set the
coordinates for the first point on the circumference
of a circle centred on the origin as:
• Calculate the initial value of the decision parameter
as:
• If p < 0, the next point along the circle centred on (0,
0) is (x+1, y) and:
))
roundoff(
,
0
(
)
,
( r
y
x
r
p
4
5
1
2
x
p
p
Rendering
Computer Grapics - CSL 1603
35. Mid-Point Circle Algorithm
• Otherwise the next point along the circle is
(x+1, y-1) and
• Determine symmetry points in the other seven
octants
• Move each calculated pixel position (x, y) onto
the circular path centred at (xc, yc) to plot the
coordinate values:
• Repeat steps 3 to 5 until x >= y
y
x
p
p 2
1
2
c
x
x
x
c
y
y
y
Rendering
Computer Grapics - CSL 1603