Draw curve in HP-GL/2

How do I draw a curve using HP-GL/2? What is the command?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You have no direct way to draw a generic curve; you must have the whole sequence of points that conform the curve, so you can draw each portion as a line segment, something like this:

PU x0,y0; PD x1,y1; x2,y2; x3,y3; ... xn, yn;

That makes a pen up (no draw) and move up to coordinates (x0,y0), the first point of the curve. Then, make a pen down (draw) and move up to (x1,y1); from there, continue up to (x2,y2), etc..

Of course, points must be close enough to have a good resolution. If not, you must use special algorithms known as "Bèzier curve", or "B-Spline", which let you compute a mean curve knowing only the extreme points, a marvelous way of solving a curve in order to minimize saw-tooth effect (i.e.: when you apply a big zoom factor to a piece of image).


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
suhaniAuthor Commented:
Thanks to you, dude !!

Are you writing a drawing program or what?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Printers and Scanners

From novice to tech pro — start learning today.