The Mid Point Algorithm Essay

835 words - 4 pages

* Midpoint Algorithm for the line of 1<m<∞

| | |
M1N pixel | M2NE pixel | |
M | | |

The equation for the line
ax + by + c = 0 1

The equation for the M point:
d – Equation for the first midpoint

d = a(x+1/2) + b(y+1) + c
d = ax + by + c + a/2 + b
d = 0 + a/2 + b
d = a/2+b
×2
d = a + 2b 2
By substituting the value fora and b we will able to find the value of d.
If d > 0, then we will select the N (North) pixel
If d < 0, then we will select NE (Northeast) pixel

Then there are two possibilities to go the line through M1 or M2
Equation for the above two points; M1 and M2
M1:
d1 – Equation for the M1 midpoint
d1 = a(x+1/2) ...view middle of the document...

In the first scenario we can choose East pixel and SouthEast pixels
d = initial decision variable.
d = X2b2 + Y2a2 - a2b2
d= (x+1)2b2 +(y-1/2)2 - a2b2
d = x2b2 + y2a2 - a2b2 + 2b2x + b2 - a2y + a2/4

d = 0 + 2b2x + b2 - a2y + a2/4 ;Since at the beginning x =0 and y = b the equation finally would be like below.
d = b2 –a2b + a2/4 1
if d < 0 we choose E pixel
if d >= 0 we choose SE pixel.
If we consider d<0 ; next pixel is E,
de = X2b2 + Y2a2 - a2b2
de = (x+2)2b2 +(y-1/2)2 - a2b2
de = x2b2 + y2a2 - a2b2 + 4b2x + 4b2 - a2y + a2/4
de = 0 + 4b2x +4b2 - a2y + a2/4
de-d = (4b2x +4b2 - a2y + a2/4) –( 2b2x + b2 - a2y + a2/4)
de= 2b2x +3b2 + d 2

If we consider d >= 0 ; next pixel is SE,
dse = X2b2 + Y2a2 - a2b2
dse = (x+2)2b2 +(y-3/2)2 - a2b2
dse = x2b2 + y2a2 - a2b2 + 4b2x + 4b2 - 3a2y + 9a2/4
dse = 0 + 4b2x +4b2 - 3a2y + 9a2/4
dse-d = (4b2x +4b2 -3 a2y + 9a2/4) –( 2b2x + b2 - a2y + a2/4)
dse= 2b2x +3b2 -2a2y + 2 a2+ d
dse= b2 (2x+3) +a2(-2y + 2) + d 3

Scenario 2 -...

Other Papers Like The Mid Point Algorithm

Data Mining Essay

1029 words - 5 pages location, economic indicators, and competition of other companies. With the use of data mining a retailer can look at point of sale records of a customer purchases to send promotions to certain areas based on purchases made. An example of this is Blockbuster looking at movie rentals to send customers updates regarding new movies depending on their previous rent list. Another example would be American express suggesting products to card holders

Probabilistic Robotics Navigation Essay

3459 words - 14 pages and the intrinsic limitations of modeling complex physical phenomena. This direction changed in the mid-1980s when the paradigm shifted toward reactive techniques. Reactive controllers rely on sensors to generate robot control. Probabilistic robotics has emerged since the mid1990s, leveraging decades of research in probability theory, statistics, engineering, and operations research. More recently, probabilistic techniques have solved many

Operations Research

3104 words - 13 pages the size of the steps required hence increasing the time needed. One important point to take into consideration is that computational complexity is not dependent on the capacity of the machine or in other words, it is independent of implementation. This factor becomes important because different machines may take different times `while processing the same ‘b’ basic steps. Another important point to consider is that for any algorithm with

Optimal Packet Routing Scheme with Multiple Sources and Multiple Destinations

2966 words - 12 pages the Torricelli point. In the figure, a, b and c are the given vertices. We construct an equilateral triangle ? abd, and circumscribe it. The Torricelli point, is the point of intersection of line segment cd and the circumcircle of equilateral triangle ? abd. And the line cd is also the Simpson line. Figure 3. Another method to obtain Torricelli point S. These properties would be used to find the Torricelli point in the proposed algorithm

Routing Protocols

590 words - 3 pages , density based probabilistic algorithm is used on DSR protocol to develop optimal strategy to route packets. By conducting several experiments on different protocols under the conditions like routing path, malicious nodes, and topologies we can select the best routing protocol to transfer data packets. Hence, by considering the entire test results show that DSR protocol is suited in some conditions like malicious nodes and topologies (Natsheh, Buragga, & Mamoun, 2010) and DSDV protocol is used when routing path is the main point of consideration (Kumar, Kulkarni, & Gupta).

An Extensive Unification of Massive Multiplayer Online Role-Playing Games and 802.11b

1727 words - 7 pages manner. Nevertheless, DNS might not be the panacea that electrical engineers expected. This combination of properties has not yet been studied in existing work. Our main contributions are as follows. We describe a method for read-write configurations (Epen), proving that the little-known mod- 1 ular algorithm for the development of widearea networks by Anderson and Thomas runs in (log n) time. We use symbiotic theory to demonstrate

Hardware Software System & Network

3657 words - 15 pages context exchanging can occur in all circumstances but pre-emption occurs only at times the process is about to return to user-mode. The OS attains a Pre-emptive scheduling by non-pre-emptive kernel. A pre-emptive algorithm allows running processes to be momentarily suspended; a non-pre-emptive algorithm will let go the CPU only after finishing point (see appendices for more details). Figure: Process scenario in Linux Linux CPU Scheduler Operating

Programming

309 words - 2 pages Short Answers 1. Modules help you in the sense of reducing the duplication of programs within a program. 2. The module has two parts, the body and header. The header indicates the starting point and the body is a list of statements that belong to the module. 3. When the module is executing, the computer jumps to that module and executes the statements in the modules body. 4. The local variable is declared in the module. It also belongs in

Startup Opp Description

3243 words - 13 pages waste less food. The solution is Mela. Mela is a subscription service that makes the grocery buying more efficient and reducing food waste is its primary objective. Mela uses an algorithm that provides curated weekly menus based on food preferences, lifestyle, and budget. Users complete an initial questionnaire to create a custom food preference profile (for themselves and/or their household) as well as their weekly budget. This initial capture

Mathematics Of Persia

1067 words - 5 pages the procedureterminate at some point. Specific algorithms sometimes also go by the name method,procedure, or technique. Khwarazmi, a remarkable mathematician and astronomer,wrote precise astronomical tables and the first work of algebra, The Book ofIntegration & Equation. The word "algebra" is derived from this book's title and theword "algorithm" from his own name. He helped establish the concept of zero andperfect the decimal system. The

Devry Cis 115 Week 4 Excercise

680 words - 3 pages Week 4 Activity—Parcel Charges ------------------------------------------------- TCO 4—Given a simple problem that requires one or more decisions, create a solution algorithm that uses decisions with logical and relational expressions. ------------------------------------------------- TCO 8 —Given a more complex problem, develop a complete solution that includes a comprehensive statement of the problem, complete program design, and program

Related Essays

The Research Of Robot Path Planning System

981 words - 4 pages from the starting point to the end in an environment with robots. The path should be avoiding the collisions. Besides, the path planning requires that the path should be as smooth as possible and meet a certain security. This thesis focus on the characteristic of path planning, analyzes the advantages and disadvantages of various path planning methods, for example, topological method, Genetic Algorithm, Neural network algorithm, Simulated

Program Design And Tools Essay

928 words - 4 pages PROGRAM DESIGN TOOLS Algorithms, Flow Charts, Pseudo codes and Decision Tables Designed by Parul Khurana, LIECA. Introduction • The various tools collectively referred to as program design tools, that helps in planning the program are:– Algorithm. – Flowchart. – Pseudo-code. Designed by Parul Khurana, LIECA. Algorithms • An algorithm is defined as a finite sequence of instructions defining the solution of a particular problem

Backtracking [Unfinished] Essay

2317 words - 10 pages algorithm “would start over from the beginning and try a different path” (Nayak & Stojmenovic, 2008). While multiple calculations can be made per millisecond, this approach is very inefficient because it “would likely follow part of the same path from the beginning to some point before [it] encountered the blocked passage” (Nayak & Stojmenovic, 2008). The benefit of a backtracking approach is its efficiency when an obstruction in the puzzle

Progamming 2 Proj Essay

550 words - 3 pages of the 15-value integer array you declared and initialized earlier, then display the result. The result returned from the function is to be displayed in the main module, not in the function. 6) Implement the linear search (also called the sequential search) algorithm from the pseudocode given in the arrays lecture. 7) Demonstrate how the sequential search algorithm can be used in your main module. You should allow the user to enter an