# Visualization Question:

## Download Job Interview Questions and Answers PDF

## What is Ellipse generating Algorithm in Visualization?

## Answer:

Algorithm

Step 1:Input radius rx, ry and ellipse center(Xc, Yc)and obtain the first

point on the circumference of a circle centered on the origin as

(X0, Y0) = (0, ry)

Step 2: Calculate the initial values of the decision parameter in region 1 as

P10 = ry

2 - rx

2 ry + 1/4 rx

2

Step 3: At each position starting at Xk position in region 1,starting at k = 0,

perform the following test:

If Pk < 0, the next point to plot is (Xk+1, Yk) and

P1k+1 = P1k+2 ry

2Xk+1 + ry

2

Otherwise the next point is (Xk+1, Yk-1) and

P1k+1 = P1k+2 ry

2Xk+1 - 2ry

2 Yk+1 + ry

2

Step 4: Calculate the initial values of the decision parameter in region 2 as

P20 = ry

2 (X0+1/2)2+ rx

2 (Y0 - 1)2- rx

2 ry

2

Step 5: At each position starting at Yk position in region 2,starting at k = 0,

perform the following test:

If Pk > 0, the next point to plot is (Xk, Yk-1) and

22

P2k+1 = P2k - 2 ry

2Yk+1 + rx

2

Otherwise the next point is (Xk+1, Yk-1) and

P2k+1 = P2k - 2 ry

2Yk+1 - 2rx

2 Yk+1 + rx

2

Step 6: Determine symmetry points in the other three octants

Step 7: Move each pixel position(X, Y) onto the circular path centred on

(Xc, Yc) and plot the coordinate values as

X = X + Xc Y = Y + Yc

Step 8: Repeat steps for region 1 until 2 ry

2X>=2 ry

2Y

Step 1:Input radius rx, ry and ellipse center(Xc, Yc)and obtain the first

point on the circumference of a circle centered on the origin as

(X0, Y0) = (0, ry)

Step 2: Calculate the initial values of the decision parameter in region 1 as

P10 = ry

2 - rx

2 ry + 1/4 rx

2

Step 3: At each position starting at Xk position in region 1,starting at k = 0,

perform the following test:

If Pk < 0, the next point to plot is (Xk+1, Yk) and

P1k+1 = P1k+2 ry

2Xk+1 + ry

2

Otherwise the next point is (Xk+1, Yk-1) and

P1k+1 = P1k+2 ry

2Xk+1 - 2ry

2 Yk+1 + ry

2

Step 4: Calculate the initial values of the decision parameter in region 2 as

P20 = ry

2 (X0+1/2)2+ rx

2 (Y0 - 1)2- rx

2 ry

2

Step 5: At each position starting at Yk position in region 2,starting at k = 0,

perform the following test:

If Pk > 0, the next point to plot is (Xk, Yk-1) and

22

P2k+1 = P2k - 2 ry

2Yk+1 + rx

2

Otherwise the next point is (Xk+1, Yk-1) and

P2k+1 = P2k - 2 ry

2Yk+1 - 2rx

2 Yk+1 + rx

2

Step 6: Determine symmetry points in the other three octants

Step 7: Move each pixel position(X, Y) onto the circular path centred on

(Xc, Yc) and plot the coordinate values as

X = X + Xc Y = Y + Yc

Step 8: Repeat steps for region 1 until 2 ry

2X>=2 ry

2Y

**Download**Visualization Interview Questions And Answers

Previous Question | Next Question |

What is Depth sorting method in Visualization? | Which major components (hardware and software) are needed for computer graphics? |