C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
Polynomial Method:The ellipse has a major and minor axis. If a1 and b1are major and minor axis respectively. The centre of ellipse is (i, j). The value of x will be incremented from i to a1and value of y will be calculated using the following formula Drawback of Polynomial Method:
Algorithm:1. Set the initial variables: a = length of major axis; b = length of minor axis; (h, k) = coordinates of ellipse center; x = 0; i = step; xend = a. 2. Test to determine whether the entire ellipse has been scan-converted. If x>xend, stop. 3. Compute the value of the y coordinate: 4. Plot the four points, found by symmetry, at the current (x, y) coordinates: Plot (x + h, y + k) Plot (-x + h, -y + k) Plot (-y - h, x + k) Plot (y + h, -x + k) 5. Increment x; x = x + i. 6. Go to step 2. Program to draw an Ellipse using Polynomial Method:#include Output:
Next TopicTrignometric Method
|