home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / windows / x / 15257 < prev    next >
Encoding:
Internet Message Format  |  1992-08-14  |  1.2 KB

  1. Path: sparky!uunet!mcsun!uknet!root44!kieron
  2. From: kieron@root.co.uk (Kieron Drake)
  3. Newsgroups: comp.windows.x
  4. Subject: Re: drawarc algorithm
  5. Message-ID: <Bsz0B9.n0C@root.co.uk>
  6. Date: 14 Aug 92 11:09:07 GMT
  7. References: <1992Aug12.202515.17072@mnemosyne.cs.du.edu>
  8. Organization: UniSoft Ltd., London, England
  9. Lines: 23
  10.  
  11. [ Description of problem getting arc to end on a radial line ]
  12.  
  13. If you read further on in the manual you will see that there is a
  14. discussion of the necessity to specify angles in the skewed coordinate
  15. system of the ellipse being drawn. Your problem is that you are specifying
  16. the same, unskewed, angle for both the line drawing and the arc drawing.
  17.  
  18. You need to translate the unskewed angle, a2 in your example, to the
  19. skewed coordinate system of the ellipse, using:
  20.  
  21.     skewed_angle = atan(tan(a2) * width/height) +
  22.         (a2 < M_PI/2.0) ? 0 :
  23.         (a2 < 3.0*M_PI/2.0) ? M_PI : 2.0*M_PI;
  24.  
  25. (This assumes a2 is in radians and is in the range 0 to 2.0*M_PI)
  26.  
  27.     kieron
  28.  
  29. -- 
  30. kieron@root.co.uk    Tel: +44 71 729 3773 (or 071 729 3773 in the UK)
  31. Kieron Drake        Fax: +44 71 729 3273 (or 071 729 3273 in the UK)
  32. Senior Consultant, UniSoft Ltd., Spa house, Chapel Place, Rivington Street,
  33. London EC2A 3DQ, UK
  34.