English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I want to know how to draw a circle by using black color points in 'c' programing (by using for loop) for that i want to know its equation

2006-08-04 21:23:21 · 4 answers · asked by Anonymous in Science & Mathematics Mathematics

4 answers

I'll write the code in VB but it should look really similar in C.

The "PointOn(x, y)" function can be substituted by whatever you use.
Given radius r and center (x, y):

---------------------------
For i = x -r to x +r

PointOn(i, y+(r^2 - x^2)^(1/2)))
PointOn(i, y -(r^2 - x^2)^(1/2)))

Next i
------------------------------

2006-08-04 22:00:57 · answer #1 · answered by mikebironneau 2 · 0 0

(rcosa,rsina) represents the co-ordinates of any point on the circle.where r is the radius of the circle.and a is the angle made by the line joining the point and the centre with the horizon.
probably run the loop by varying a from 0 to 360 degrees and print the dot using gotoxy function as per dos compiler..
plz take care while doing the program

2006-08-05 06:01:31 · answer #2 · answered by ? 2 · 0 0

(x-a)^2+(y-b)^2

2006-08-05 06:01:14 · answer #3 · answered by sh.akbari 2 · 0 0

y=sqrt(r^2-x^2);
y=-sqrt(r^2-x^2)

2006-08-05 04:34:48 · answer #4 · answered by r083r70v1ch 4 · 0 0

fedest.com, questions and answers