2D Algorithms(Midpoint Circle Algorithm) Computer Graphics

  • Published on
    09-Mar-2015

  • View
    328

  • Download
    1

Transcript

Computer Graphics (L06)EG678EX

2-D Algorithms

Prepared By: Dipesh Gautam

1

Midpoint Circle AlgorithmCircle function defined as:f circle ( x, y ) ! x 2 y 2 r 2

Any point (x,y) satisfies following conditions 0, f circle ( x, y )! 0, 0, " if ( x, y ) if ( x, y ) if ( x, y ) is inside the circle boundary is on the circle boundary is outside the circle boundary2

Prepared By: Dipesh Gautam

Decision parameter is the circle function; evaluated as:p k ! f circle ( x k 1, y k 1 ) 2 1 ! ( x k 1) 2 ( y k ) 2 r 2 2

1 pk 1 ! f circle ( xk 1 1, yk 1 ) 2 1 ! [( xk 1) 1]2 ( yk 1 ) 2 r 2 2 2 2 pk 1 ! pk 2( xk 1) ( yk 1 yk ) ( yk 1 yk ) 1

Prepared By: Dipesh Gautam

3

yk+1 = yk if pk

Recommended

View more >