written 5.4 years ago by |
$x= rcos\theta$
$y=rsin\theta$
where $0\le \theta \le 2\pi$........................(1)
If uniformly spaced points lie on the periphery of the circle, then $\delta \theta=$consatnt (increament in angle)
$\therefore$ (1) can be expressed as:-
$x_{i+1}=rcos(\theta _i+\delta \theta)$
$y_{i+1}=rsin(\theta _i+\delta \theta)$
$\therefore x_{i+1}=rcos\theta _icos \delta \theta-rsin\theta _isin \delta \theta$
$\therefore y_{i+1}=rsin\theta _icos \delta \theta+rcos\theta _isin \delta \theta$
Simplifying:
$x_{i+1}=x_icos\delta \theta-y_isin \delta \theta$
$y_{i+1}=x_isin\delta \theta-y_icos \delta \theta$
A not origin circle is obtained by considering a single origin centered unit circle(generation); then scaling and translation.
E.g. Generate a circle of radius 2 with centre located at (2,2).
Solution
- Generate an origin centered circle (unit radius)
- Scale by factor of 2
- Translate by (2,2) units
Assuming 8 number of points on the circle equally spaced.
(Note: Normally, a much larger number of points is required for display, depends on the radius of circle.)
$\therefore \delta \theta =\frac{2\pi ^c}{8}=\frac{\pi ^c}{4}=45^o$
Starting with point 1;
$x_1=rcos\theta _1=1cos 0=1$
$y_1=rsin\theta _1=1sin 0=0$
$\therefore$ Using parametric equations;
we get the x and y values of the other points also.
$\therefore x_2=x_1cos\delta \theta-y_1sin\delta \theta$
$\therefore y_2=x_1sin\delta \theta+y_1cos\delta \theta$
Here; $sin\delta \theta=cos\delta \theta (\because \theta = 45)$
$=\frac{1}{\sqrt 2}$
$\therefore x_2=\frac{1}{\sqrt 2}$
$y_2=\frac{1}{\sqrt 2}$
Hence; the results for the unit circle can be translated as:-
i | $x_i$ | $y_i$ |
---|---|---|
1 | 1 | 0 |
2 | $\frac{1}{\sqrt 2}$ | $\frac{1}{\sqrt 2}$ |
3 | 0 | 1 |
4 | $-\frac{1}{\sqrt 2}$ | $\frac{1}{\sqrt 2}$ |
5 | -1 | 0 |
6 | $\frac{1}{\sqrt 2}$ | $-\frac{1}{\sqrt 2}$ |
7 | 0 | -1 |
8 | $\frac{1}{\sqrt 2}$ | $-\frac{1}{\sqrt 2}$ |
Q. Generate a circle of radius 4 width center located at (2, 2)
Sr. No. | $\theta$ | $x=x_{c}+r \cos\theta$ | $y=y_{c}+r \sin \theta$ |
---|---|---|---|
1 | $0^o$ | 6 | 2 |
2 | $45^o$ | 4.8284 | 4.8284 |
3 | $90^o$ | 2 | 6 |
4 | $135^o$ | -0.828 | 4.8284 |
5 | $180^o$ | -2 | 2 |
6 | $225^o$ | -0.828 | -0.828 |
7 | $270^o$ | 2 | -2 |
8 | $315^o$ | 4.8284 | -0.828 |
9 | $360^o$ | 6 | 2 |
Q. Generate a circle (0 to $90^o$ ) of radius 4 width center located at (2, 2) in incremental co-ordinate.
Sr No | $\theta$ | $x_i$ | $y_i$ | $x = x_c + rcos \theta$ | $y = y_c + rsin \theta$ |
---|---|---|---|---|---|
1 | $0^o$ | - | - | 6 | 2 |
2 | $30^o$ | 6 | 2 | 5.464 | 4 |
1 | $60^o$ | 5.464 | 4 | 3.999 | 5.464 |
1 | $90^o$ | 4 | 5.464 | 2 | 6 |