Tilted Ellipse

Tilted Ellipse

Post by David Paters » Fri, 02 Nov 1990 01:46:00



Stephen Johnson of Sun Microsystems, California asks:
$ Maybe someone has a better technique for generating that skewed
$ ellipse at the quickest speed possible.

Here are two related methods. The first method is best if the maximum
speed at given (imperfect) accuracy is required. It is faster than
the second method which gives the maximum speed at perfect accuracy.
By the way, I can't think of any algorithm that works more than twenty
per cent faster for non-tilted ellipses than tilted ones.

Lets suppose that the tilted ellipse is specified by the
major axis, minor axis, x at centre, y at centre and slope.
Call these values MAJOR, MINOR, Xcentre, Ycentre, SLOPE.

The tilted ellipse has points with coordinates:


where:
 a = .5 * MAJOR * cos(SLOPE)
 b = -.5 * MINOR * sin(SLOPE)
 c = .5 * MAJOR * sin(SLOPE)
 d = .5 * MINOR * cos(SLOPE)




where:
 A = sqrt(a*a+b*b)
 B = sqrt(c*c+d*d)
 ANGLE = arcsin(c/B)-arcsin(a/A)

The values A, B and ANGLE are calculated once for each ellipse.

        -----

METHOD 1


   Find Xcentre, Ycentre, A, B, and ANGLE once for each ellipse.




   Join new values of X and Y to old values of X and Y with a straight line.


of the resulting ellipse.

        -----

METHOD 2


   Find Xcentre, Ycentre, 1/A, B, and ANGLE once for each ellipse.

   Increment X and find Y from


   Join new value of Y to old value of Y with a vertical line.

Here X is incremented one pixel at a time. Don't forget that
arcsin has two values; one for the top half of the ellipse and
one for the bottom half.

        -----

                David Paterson,

                CSIRO Division of B,C & E,
                PO Box 56 Highett, Victoria. 3190.

 
 
 

1. tilted ellipse, rasterize code ?

Does anyone know where I might findcode to
create a rasterized tilted ellipse ?  I'm looking for
something along the lines of a Bresenham's line/cirle
algorithm. Ellipse algorithms are easy to find but I
can't seem to find one for a _tilted_ ellipse.
Help !
  Thanx,
    Chris

2. Query: Multiple sound in MAX

3. Tilted ellipses

4. NASA Research Announcement in Scientific Visualization

5. Tilted ellipse.

6. Layer mask VS Channel mask

7. Need guidance for rendering a tilted ellipse

8. Povray glass bottle

9. Tilted Ellipses in Windows

10. Tilted ellipses

11. Bresenham-type algorithm for tilted ellipses??

12. Need tilted ellipse algorithm

13. Is ellipse completely contained in another ellipse?