انت هنا الان : شبكة جامعة بابل > موقع الكلية > نظام التعليم الالكتروني > مشاهدة المحاضرة
الكلية كلية العلوم للبنات
القسم قسم الحاسبات
المرحلة 3
أستاذ المادة ود كاظم عليوي حوشان البديوي
17/11/2014 04:39:25
Introduction to computer algorithm :
Before getting started in computer graphics algorithms we need to know what the term computer algorithm means. An algorithm is any well-defined computational procedure that takes some values as input and produces some values as output. Like a cooking recipe, an algorithm provides a step-by-step method for solving a computational problem. Unlike programs, algorithms are not dependent on a particular programming language, machine, system, or compiler (usually described using natural language and pseudo code). They are mathematical entities, which can be thought of as running on some sort of idealized computer with an infinite random access memory and an unlimited word size. Algorithm design is all about the mathematical theory behind the design of good programs. The process of writing an algorithm is just taking your problem, and breaking it down, abstracting it to be able to be solved without a computer. Then you can translate those steps into code.
Computer algorithm has the following features: – A detailed step-by-step instruction. – ”No ambiguity” - no fuzz! – Careful specification of the input and the output.
Note that: • The same algorithm may be represented in many different ways • Several [different] algorithms may exist for solving a particular problem • Algorithms for the same problem can be based on very different ideas and have very different properties.
The following algorithms will deal with drawing straight lines, circles, arcs and different figures. First, to draw any figure we need to the following aspects: 1- Determine the arithmetic relations and operators to draw the figure. 2- Determine the start point of the draw. 3- Find the others points to draw the figure, that by find: - The amount of increasing of new x, y from the old one. It s must be regular or dependents. - Find the number of points that required to draw ( find number of iterations of loop to draw). - Find the stop condition of loop .
Line Drawing Algorithms The straight line is the simplest geometric figure. Its explicit equation is: y = ax + b where a is the slope and b is the y-intercept. We have the coordinates of the two endpoints (x1 ,y1 ) and (x2 ,y2 ) of line, therefore it is easy to express a and b in terms of the endpoints. The slope a is simply (y2 ? y1 )/(x2 ? x1 )or?y/?x. The value of b is obtained from y1 = a * x1 + b, which implies: Our first algorithm uses (x1 ,y1 ) and (x2 ,y2 ) to compute a and b, and then executes loop as in algorithm (1). However, this loop is very slow because it uses multiplications and also because it works with real quantities that have to be rounded to integers. A better algorithm should use just additions/subtractions and just integers.
Introduction to computer algorithm :
Before getting started in computer graphics algorithms we need to know what the term computer algorithm means. An algorithm is any well-defined computational procedure that takes some values as input and produces some values as output. Like a cooking recipe, an algorithm provides a step-by-step method for solving a computational problem. Unlike programs, algorithms are not dependent on a particular programming language, machine, system, or compiler (usually described using natural language and pseudo code). They are mathematical entities, which can be thought of as running on some sort of idealized computer with an infinite random access memory and an unlimited word size. Algorithm design is all about the mathematical theory behind the design of good programs. The process of writing an algorithm is just taking your problem, and breaking it down, abstracting it to be able to be solved without a computer. Then you can translate those steps into code.
Computer algorithm has the following features: – A detailed step-by-step instruction. – ”No ambiguity” - no fuzz! – Careful specification of the input and the output.
Note that: • The same algorithm may be represented in many different ways • Several [different] algorithms may exist for solving a particular problem • Algorithms for the same problem can be based on very different ideas and have very different properties.
The following algorithms will deal with drawing straight lines, circles, arcs and different figures. First, to draw any figure we need to the following aspects: 1- Determine the arithmetic relations and operators to draw the figure. 2- Determine the start point of the draw. 3- Find the others points to draw the figure, that by find: - The amount of increasing of new x, y from the old one. It s must be regular or dependents. - Find the number of points that required to draw ( find number of iterations of loop to draw). - Find the stop condition of loop .
Line Drawing Algorithms The straight line is the simplest geometric figure. Its explicit equation is: y = ax + b where a is the slope and b is the y-intercept. We have the coordinates of the two endpoints (x1 ,y1 ) and (x2 ,y2 ) of line, therefore it is easy to express a and b in terms of the endpoints. The slope a is simply (y2 ? y1 )/(x2 ? x1 )or?y/?x. The value of b is obtained from y1 = a * x1 + b, which implies: Our first algorithm uses (x1 ,y1 ) and (x2 ,y2 ) to compute a and b, and then executes loop as in algorithm (1). However, this loop is very slow because it uses multiplications and also because it works with real quantities that have to be rounded to integers. A better algorithm should use just additions/subtractions and just integers.
المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .
الرجوع الى لوحة التحكم
|