The document describes algorithms for scan converting lines and circles in raster graphics.
For line drawing, it discusses direct solutions, the digital difference analyzer (DDA) algorithm, and the midpoint line algorithm. The midpoint line algorithm uses incremental calculations and the sign of a decision variable to determine whether to select the east or northeast pixel at each step.
For circle drawing, it describes using the implicit equation and symmetry to scan convert circles centered at the origin. It then presents the midpoint circle algorithm, which similarly uses a decision variable and incremental updates to select between the east and southeast pixels at each step.
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
It gives detailed description about Points, Lines, Attributes of Output Primitives, Line Functions, Line Drawing Algorithms, DDA Line drawing algorithms, Bresenham’s Line Algorithm, Circle Generating Algorthims
This slide contain description about the line, circle and ellipse drawing algorithm in computer graphics. It also deals with the filled area primitive.
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfPeter Spielvogel
Building better applications for business users with SAP Fiori.
• What is SAP Fiori and why it matters to you
• How a better user experience drives measurable business benefits
• How to get started with SAP Fiori today
• How SAP Fiori elements accelerates application development
• How SAP Build Code includes SAP Fiori tools and other generative artificial intelligence capabilities
• How SAP Fiori paves the way for using AI in SAP apps
GridMate - End to end testing is a critical piece to ensure quality and avoid...ThomasParaiso2
End to end testing is a critical piece to ensure quality and avoid regressions. In this session, we share our journey building an E2E testing pipeline for GridMate components (LWC and Aura) using Cypress, JSForce, FakerJS…
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Sudheer Mechineni, Head of Application Frameworks, Standard Chartered Bank
Discover how Standard Chartered Bank harnessed the power of Neo4j to transform complex data access challenges into a dynamic, scalable graph database solution. This keynote will cover their journey from initial adoption to deploying a fully automated, enterprise-grade causal cluster, highlighting key strategies for modelling organisational changes and ensuring robust disaster recovery. Learn how these innovations have not only enhanced Standard Chartered Bank’s data infrastructure but also positioned them as pioneers in the banking sector’s adoption of graph technology.
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
2. LINE DRAWING
Description: Given the specification for a
straight line, find the collection of
addressable pixels which most closely
approximates this line.
Goals (not all of them are achievable with
the discrete space of a raster device):
• Straight lines should appear straight.
• Lines should start and end accurately,
matching endpoints with connecting lines.
• Lines should have constant brightness.
• Lines should be drawn as rapidly as possible.
3. Problems:
How do we determine which pixels to
illuminate to satisfy the above goals?
Vertical, horizontal, and lines with slope
= +/- 1, are easy to draw.
Others create problems: stair-casing/
jaggies/aliasing.
Quality of the line drawn depends on the
location of the pixels and their brightness
4. It is difficult to determine whether
a pixel belongs to an object
5. Direct Solution:
Solve y=mx+b, where (0,b) is the y-intercept
and m is the slope.
Go from x0 to x1:
calculate round(y) from the equation.
Take an example, b = 1 (starting point (0,1))
and m = 3/5.
Then x
x
x
x
x
=
=
=
=
=
1,
2,
3,
4,
5,
y
y
y
y
y
=
=
=
=
=
2
2
3
3
4
=
=
=
=
=
round(8/5)
round(11/5)
round(14/5)
round(17/5)
round(20/5)
For results, see next slide.
7. Choice of pixels in the raster, as integer values
x = 1, y = 2 = round(8/5)
x = 2, y = 2 = round(11/5)
x = 3, y = 3 = round(14/5)
x = 4, y = 3 = round(17/5)
x = 5, y = 4 = round(20/5)
Using next highest
4
3
2
(0,1)
(5,4)
Using Round
4
3
2
(0,1)
(5,4)
8. Why is this undesired?
• `*´ and `/´ are expensive
• Round() function needed
• Can get gaps in the line (if slope > 1)
Take another example:
y = 10.x + 2
x=1, y=12;
x=2, y=22.
9. DDA - Digital Difference Analyzer
Incremental Algorithm.
Based on y = (y1- y0) / (x1-x0) x + b
Assume x1 > x0 and |dx| > |dy|
(can be easily modified for the other
cases.)
The Algorithm: dx = x1- x0 ;
dy = y1- y0 ;
m = dy/dx ;
y = y0 ;
for (x=x0 to x1)
draw_point (x, round(y)) ;
y=y+m;
end for
12. MIDPOINT LINE ALGORITHM
Incremental Algorithm (Assume first octant)
Given the choice of the current pixel,
which one do we choose next : E or NE?
Equations:
1. y = (dy/dx) * x + B
Rewrite as:
2. F(x,y) = a*x + b*y + c = 0
Gives: F(x,y) = dy*x - dx*y + B*dx = 0
=> a = dy, b = -dx, c = B*dx
13. Criteria:
Evaluate the mid-point, M,
w.r.t. the equation of the line.
Choice: E or NE?
NE
E
M
F(x,y) = dy*x - dx*y + B*dx =0
F(x,y) > 0; if point below the line
F(x,y) < 0; if point above the line
14. NE (Xp+1, Yp+1)
Q
M
(Xp+1, Yp+1/2)
E
(Xp, Yp)
(Xp+1, Yp)
Q is above M,
hence select NE pixel as your next choice
15. NE (Xp+1, Yp+1)
M (Xp+1, Yp+1/2)
Q
E
(Xp, Yp)
(Xp+1, Yp)
Q is below M, hence
select E pixel as
your next choice
ALGO – for next choice:
If F(M) > 0 /*Q is above M */
then Select NE
/*M is below the line*/
else Select E ;
/* also with F(M) = 0 */
16. Evaluate mid-point M using a decision
variable d = F(X,Y);
d = F(Xp+1,Yp+1/2) = a(Xp+1)+b(Yp+1/2)+c;
at M,
Set dold = d;
Based on the sign of d, you choose E or NE.
Case I. Chosen E:
dnew = F(Xp+2,Yp+1/2)
= a(Xp+2) + b(Yp+1/2) + c
(d)E = dnew - dold = a
/* = dy */
17. NE (Xp+1, Yp+1)
Q
Case II.
Chosen NE:
M
(Xp+1, Yp+1/2)
E
(Xp, Yp)
(Xp+1, Yp)
dnew = F(Xp+2,Yp+3/2)
= a(Xp+2) + b(Yp+3/2) + c
(d)NE = dnew - dold = a + b /*= dy – dx */
Update using dnew = dold + d
18. Midpoint criteria
d = F(M) = F(Xp+1, Yp+1/2);
if d > 0 choose NE
else /* if d <= 0 */ choose E ;
Case EAST :
increment M by 1 in x
dnew= F(Mnew) = F(Xp + 2, Y + 1/2)
(d)E = dnew - dold = a = dy
(d)E = dy
Case NORTH-EAST:
increment M by 1 in both x and y
dnew= F(Mnew) = F(Xp + 2, Yp + 3/2)
(d)NE = dnew - dold = a + b = dy - dx
(d)NE = dy - dx
19. What is dstart?
dstart = F(x0 + 1, y0 + 1/2)
= ax0 + a + by0 + b/2 + c
= F(x0, y0)+ a + b/2
= dy - dx/2
Let's get rid of the fraction and see what
we end up with for all the variables:
dstart
= 2dy – dx ;
(d)E
= 2dy ;
(d)NE = 2(dy - dx) ;
20. The Midpoint Line Algorithm
x
= x0;
y
dy = y1 - y0 ;
d
= y0;
dx = x1 - x0;
= 2dy – dx;
(d)E = 2dy;
(d)NE = 2(dy - dx);
Plot_Point(x,y)
21. The Midpoint Line Algorithm (Contd.)
while (x < x1)
if (d <= 0) /* Choose E */
d = d + (d)E ;
else
/* Choose NE */
d = d + (d)NE ;
y=y+1
endif
x=x+1;
Plot_Point(x, y) ;
end while
23. We have considered lines in the first
Quadrant only.
What about
the rest?
3
2
4
1
5
8
6
7
24. How do you generalize this to the other
octants?
Octant
Change
1
none
2
Switch roles of x & y
3
Switch roles of x & y; Use (4)
4
Draw from P1 to P0; Use (8)
5
Draw from P1 to P0
6
Draw from P1 to P0; Use (2)
7
Switch roles of x & y; Use (8)
8
Use y = y - 1.
25. 3
2
4
Octant
1
Change
None
1
5
8
6
2
Switch roles of x & y
3
Switch roles of x & y; Use (4)
4
Draw from P1 to P0; Use (8)
5
Draw from P1 to P0
6
Draw from P1 to P0; Use (2)
7
Switch roles of x & y; Use (8)
8
Use y = y - 1.
7
26. Draw from P1 to P0:
swap(P0, P1).
Use y = y - 1;
dy = -dy;
Switch Roles of X & Y:
Swap (x1, y1);
Swap (x0, y0 );
Swap (dx, dy);
plot_point(y, x);
29. X=Xmin
NE
[Xmin, round(m.Xmin + b)]
P
[Xmin, m.Xmin + b]
M
E
Q
Y=Ymin
Intersection of a line with a vertical
edge of the clip rectangle
30. X=Xmin
NE
[Xmin, round(m.Xmin + b)]
P
E
[Xmin, m.Xmin + b]
M
Q
Y=Ymin
No problem in this case to round off the
starting point, as that would have been a point
selected by mid-point criteria too.
Select P by rounding the intersection point
coordinates at Q.
31. X=Xmin
NE
[Xmin, round(m.Xmin + b)]
P
E
[Xmin, m.Xmin + b]
Q
M
Y=Y
min
What about dstart?
If you initialize the algorithm from P, and
then scan convert, you are basically changing “dy”
and hence the original slope of the line.
Hence, start by initializing from d(M), the
mid-point in the next column, (Xmin+ 1), after
clipping).
33. Intersection of line with edge and then
rounding off produces A, not B.
To get B, as a part of the clipped line:
Obtain intersection of line with (Ymin - 1/2)
and then round off, as
B = [round(X|Ymin-1/2), Ymin]
37. CIRCLE DRAWING
Only considers circles centered at the origin
with integer radii.
Can apply translations to get non-origin
centered circles.
Explicit equation: y = +/- sqrt(R2 - x2)
Implicit equation: F(x,y)= x2 + y2 - R2 =0
Note: Implicit equations used extensively
for advanced modeling
(e.g., liquid metal creature from
"Terminator 2")
38. Use of Symmetry: Only need to calculate one
octant. One can get points in the other 7
octants as follows:
Draw_circle(x, y)
begin
Plotpoint (x, y); Plotpoint (y, x);
Plotpoint (x, -y); Plotpoint (-y, x);
Plotpoint (-x, -y) ; Plotpoint (-y, -x);
Plotpoint (-x, y); Plotpoint (-y, x);
end
40. MIDPOINT CIRCLE ALGORITHM
Will calculate points for the second octant.
Use draw_circle procedure to calculate the rest.
Now the choice is between pixels E and SE.
F(x, y) = x2 + y2 - R2 =0
F(x, y) > 0 if point is outside the circle
F(x, y) < 0 if point inside the circle.
Again, use dold = F(M) ;
F(M) = F(Xp + 1, Yp - 1/2)
= (Xp + 1)2 + (Yp - 1/2)2 - R2
41. d >= 0 choose SE ; next midpoint: Mnew;
Increment + 1 in X, -1 in y; which gives dnew.
d < 0 choose E ; next midpoint: Mnew;
Increment + 1 in X; which gives = dnew.
(d)SE = dnew – dold
= F(Xp + 2, Yp - 3/2) - F(Xp + 1, Yp - 1/2)
= 2Xp – 2Yp + 5 ;
(d)E = dnew – dold
=F(Xp + 2, Yp - 1/2) - F(Xp + 1, Yp - 1/2)
= 2Xp + 3;
dstart = F(X0 + 1, Y0 - 1/2) = F(1, R - 1/2)
= 1 + (R - 1/2)2 - R2 = 1 + R2 - R + 1/4 - R2
= 5/4 - R
42. Xp, Yp
E
M
ME
SE
MSE
To get rid of the fraction,
Let h = d - ¼
=> hstart = 1 - R
Comparison is: h < -1/4.
Since h is initialized to and incremented
by integers, so we can just do with: h < 0.
43. The Midpoint Circle algorithm:
(Version 1)
x = 0;
y = R;
h = 1 – R;
DrawCircle(x, y);
while (y > x)
if h < 0 /* select E */
h = h + 2x + 3;
44. else
endif
/* select SE */
h = h + 2(x - y) + 5;
y = y - 1;
x = x + 1;
DrawCircle(x, y);
end_while
46. Problems with this?
Requires at least 1 multiplication and
3 additions per pixel.
Why? Because (d)E and (d)SE
are linear functions and not constants.
Solution?
All we have to do is calculate the
differences for: (d)E and dSE (check if these
will be constants). Say, (d2)E and (d2)SE.
If we chose E, then we calculate (d2)E/E
and (d2)E/SE, based on this. Same if we choose
SE, then calculate (d2)SE/E and (d2)SE/SE.
47. If we chose E, go from (Xp, Yp) to (Xp + 1, Yp)
(d)E-old = 2Xp + 3, (d)E-new = 2Xp + 5.
Thus (d2)E/E = 2.
(d)SE-old = 2Xp – 2Yp + 5,
(d)SE-new = 2(Xp + 1) – 2Yp + 5
Thus (d2)E/SE = 2.
48. If we chose SE,
go from (Xp, Yp) to (Xp + 1, Yp - 1)
(d)E-old = 2Xp + 3, (d)E-new = 2Xp + 5.
Thus (d2)SE/E = 2.
(d)SE-old = 2Xp – 2Yp + 5,
(d)SE-new = 2(Xp + 1) – 2(Yp - 1) + 5
Thus (d2)SE/SE = 4.
So, at each step, we not only increment
h, but we also increment (d)E and (d)SE .
What are (d)E-start and (d)SE-start ?
(d)E-start = 2*(0) + 3 = 3 ;
(d)SE-start = 2*(0) - 2*(R) + 5
49. The MidPoint Circle Algorithm
(Version 2):
x = 0;
h=1–R;
deltaE = 3 ;
y = radius;
deltaSE = -2*R + 5 ;
DrawCircle(x, y);
while (y > x)
if h < 0
/* select E */
h = h + deltaE ;
deltaE = deltaE + 2;
deltaSE= deltaSE + 2
50. else
/* select SE */
h = h + deltaSE ;
deltaE = deltaE + 2 ;
deltaSE = deltaSE + 4
y=y–1;
endif
x=x+1;
DrawCircle(x, y) ;
end_while
54. SCAN CONVERTING ELLIPSES
b
Y
-a
a
Equation of Ellipse
centered at origin:
-b
F(X,Y) b X a Y a b 0
2
2
2
2
2
2
Length of the major axis: 2a;
and minor axis: 2b.
X
55. Y
R1
slope = -1
R2
X
Draw pixels in two regions R1 and R2,
to fill up the first Quadrant.
Points in other quadrants are obtained
using symmetry.
56. We need to obtain the point on the
contour where the slope of the curve is -1.
This helps to demarcate regions R1 and R2.
The choice of pixels in R1 is between E and SE,
whereas in R2, it is S and SE.
F(X,Y) b X a Y a b 0
2
2
f
f
In R1 :
Y X
and
f
f
in R2 :
X Y
2
2
Y
R1
2
2
f ˆ f ˆ
grad f X, Y
i
j
X
Y
(2b2 X) ˆ (2a2 Y) ˆ
i
j
slope = -1
R2
X
57. At the region boundary point on the ellipse:
f
f
X
Y
Based on this condition,
we obtain the criteria when the next mid-point
moves from R1 to R2 :
b (X p 1) a (Y p 1/2)
2
2
When the above condition occurs,
we switch from R1 to R2.
Analysis in region R1:
Let the current pixel be (Xp, Yp);
dold = F(M1);
59. Initial Condition:
In region R1, first point is (0, b).
(dinit)R1 = F(1, b - 1/2) = b2 + a2(1/4 - b) ;
Problem with a fractional (floating point) value
for (dinit)R1 ?
Switch to Region R2, when:
b (X p 1) a (Y p 1/2)
2
2
Let the last point in R1 be (Xk, Yk).
F(M2) = F(Xk + 1/2, Yk - 1)
= b2(Xk + 1/2)2 + a2(Yk - 1)2 - a2b2
= (dinit)R2