انت هنا الان : شبكة جامعة بابل > موقع الكلية > نظام التعليم الالكتروني > مشاهدة المحاضرة
الكلية كلية تكنولوجيا المعلومات
القسم قسم البرامجيات
المرحلة 3
أستاذ المادة توفيق عبد الخالق عباس الاسدي
13/12/2016 08:09:21
Circle -DRAWING ALGORITHMS
The Polar method
Cos(th)=Delta(X)/r Sin(th) =Delta(y)/r Delta(x)=r*cos(th) X-Xc=r*cos(th) X=Xc-r*cos(th) Delta(y)=r*sin(th) Y-Yc=r*sin(th) Y=Yc+r*sin(th)
The Cartesian method (Y-Yc)2 + (X-Xc)¬2 =r2 (Y-Yc)2=r2 -(X-Xc)¬2 (Y-Yc) =Sqrt(r2 -(X-Xc)¬2 ) Y= Yc +Sqrt(r2 -(X-Xc)¬2)
The Polar method
We have X=Xc+r*cos(th) …1 Y=Yc+r*sin(th) …2 Let Xc,Yc is (0,0) then the above Eq. as follow
X=r*cos(th) …3 Y=r*sin(th) …4
dx= -r*sin(th)*dth ...5 dy= r*cos(th)*dth …6 Replace Eq. 3 in Eq. 6 and 4 in 5
dx= -Y*dth …7 dy= x*dth ….8 then we can calculate any new point Xi+1 , Yi+1 depending on previous point Xi , Yi Xi+1= Xi +dx ….9 Yi+1= Yi +dY …10 Xi+1= Xi –Yi*dth ….11 Yi+1=Yi+Xi+1*dth …12 Let dth=1/r
Circle DDA with symmetric
Let Xc,Yc is (0,0) we have X=r*cos(th) …..13 Y=r*sin(th) …..14
dx= -r*sin(th)*dth ….15 dy= r*cos(th)*dth ….16
replace 13 in 16 and 14 in 15 dx= -Y*dth ….17 dy= X*dth …..18
we have Xi+1= Xi +dx ….9 Yi+1= Yi +dY …10 then Xi+1= Xi - Yi * dth ….19 Yi+1= Yi + Xi+1*dth …10
المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .
|