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
why nlogn is the lower limit of any sort algorithm?
What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql
could you please send the program code for multiplying sparse matrix in c????
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']
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.
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 ?
write a program for area of circumference of shapes
Sir... please give some important coding questions asked by product companies..
How to palindrom string in c language?
What is full form of PEPSI
Write a routine to implement the polymarker function
Write a program to model an exploding firecracker in the xy plane using a particle system
how to test pierrot divisor
Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange
Cluster head selection in Wireless Sensor Network using C programming language.