home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!root44!kieron
- From: kieron@root.co.uk (Kieron Drake)
- Newsgroups: comp.windows.x
- Subject: Re: drawarc algorithm
- Message-ID: <Bsz0B9.n0C@root.co.uk>
- Date: 14 Aug 92 11:09:07 GMT
- References: <1992Aug12.202515.17072@mnemosyne.cs.du.edu>
- Organization: UniSoft Ltd., London, England
- Lines: 23
-
- [ Description of problem getting arc to end on a radial line ]
-
- If you read further on in the manual you will see that there is a
- discussion of the necessity to specify angles in the skewed coordinate
- system of the ellipse being drawn. Your problem is that you are specifying
- the same, unskewed, angle for both the line drawing and the arc drawing.
-
- You need to translate the unskewed angle, a2 in your example, to the
- skewed coordinate system of the ellipse, using:
-
- skewed_angle = atan(tan(a2) * width/height) +
- (a2 < M_PI/2.0) ? 0 :
- (a2 < 3.0*M_PI/2.0) ? M_PI : 2.0*M_PI;
-
- (This assumes a2 is in radians and is in the range 0 to 2.0*M_PI)
-
- kieron
-
- --
- kieron@root.co.uk Tel: +44 71 729 3773 (or 071 729 3773 in the UK)
- Kieron Drake Fax: +44 71 729 3273 (or 071 729 3273 in the UK)
- Senior Consultant, UniSoft Ltd., Spa house, Chapel Place, Rivington Street,
- London EC2A 3DQ, UK
-