infinitezero
infinitezero

Reputation: 2077

How to draw an ellipse in encapsulated post script?

EPS has the arc command

xcenter ycenter radius startangle stopangle arc

which will draw a circular arc at the desired around the desired location. How can I draw an ellipse?

Upvotes: 0

Views: 205

Answers (2)

Jára
Jára

Reputation: 21

Try rather this postscript command:

/DrawEllipse {
    /endangle exch def
    /startangle exch def
    /yrad exch def
    /xrad exch def
    /y exch def
    /x exch def
    /savematrix mtrx currentmatrix def
    x y translate xrad yrad scale 0 0 1 startangle endangle arc
    savematrix setmatrix
    } def

The ellipse will never be precisely approximated by bezier curves. Stretching circle could also work.

Upvotes: 0

KenS
KenS

Reputation: 31199

With curves :-)

You need to look at the curveto operator, then define your ellipse as a series of Bezier curves.

See also the answer to this question

Upvotes: 0

Related Questions