Write a routine to draw a circle (x ** 2 + y ** 2 = r ** 2)
without making use of any floating point computations at all.

Answer Posted / daru

just use Bresenham's algo

d=1-r;
y=r;
x=0;
while(y>x)
{
if(d<0)
d+=2*x+3;
else {
d+=2*(x-y)+5;
y--;
}
x++;
plotpoints(x,y);
}

Is This Answer Correct ?    34 Yes 25 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

why nlogn is the lower limit of any sort algorithm?

2537


What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql

2621


could you please send the program code for multiplying sparse matrix in c????

3271


To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. String contains only lowercase characters ['a'-'z']

726


How can I Create a C program in splitting set of characters to specific subsets. Example: INPUT SET OF CHARACTERS: Therefore, my dear brothers and sisters, stand firm. Let nothing move you. Always give yourselves fully to the work of the Lord, because you know that your labor in the Lord is not in vain. SPLIT INTO HOW MANY CHARACTERS PER SUBSETS: 10 OUTPUT: Therefore, my dear b rothers an d sisters, stand fir m. Let not hing move you. Alway s give you rselves fu lly to the work of t he Lord, b ecause you know that your labo r in the L ord is not in vain.

2155






why do you use macros? Explain a situation where you had to incorporate macros in your proc report? use a simple instream data example with code ?

2494


write a program for area of circumference of shapes

2223


Sir... please give some important coding questions asked by product companies..

2014


How to palindrom string in c language?

9763


What is full form of PEPSI

2114


Write a routine to implement the polymarker function

4574


Write a program to model an exploding firecracker in the xy plane using a particle system

3861


how to test pierrot divisor

2453


Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange

3067


Cluster head selection in Wireless Sensor Network using C programming language.

3368