home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.x
- Path: sparky!uunet!mnemosyne.cs.du.edu!nyx!rheithof
- From: rheithof@nyx.cs.du.edu (Russell Heithoff)
- Subject: drawarc algorithm
- Message-ID: <1992Aug12.202515.17072@mnemosyne.cs.du.edu>
- Sender: usenet@mnemosyne.cs.du.edu (netnews admin account)
- Organization: Nyx, Public Access Unix (sponsored by U. of Denver Math/CS dept.)
- Disclaimer1: Nyx is a public access Unix system run by the University of
- Disclaimer2: Denver for the Denver community. The University has neither
- Disclaimer3: control over nor responsibility for the opinions of users.
- Date: Wed, 12 Aug 92 20:25:15 GMT
- Lines: 37
-
- In the Xlib Reference Manual, the description for XDrawArc states:
-
-
- "Angles are computed based solely on the coordinte
- system and ignore the aspect ratio. In other words,
- if the bounding rectangle of the arc is not square
- and angle1 is zero and angle2 is (45x64) (i.e. 45
- degrees), a line drawn from the center of the bounding
- box through the endpoint of the arc will not pass
- through the corner of the rectangle".
-
- This statement might address my problem, but if so, I'm not sure how. The
- problem becomes evident in the following sequence of events:
-
- 1 - Calculate the angle from the horizontal to a line defined
- by the center of the bounding box to some arbitrary point.
- The angle is measured in a counter clockwise direction.
- Call this a2.
-
- 2 - Draw the line described in step one. The length of the line
- is should be very long.
-
- 3 - Use XDrawArc to draw an arc using the same bounding box
- mentioned in step one, zero as angle1 and the angle
- calculated in step one (i.e. a2) as angle 2.
-
- The problem now becomes evident. The end of the arc does not meet the
- line. (Its not due to the line length).
-
- I would like to know what angle should be specified to get the arc to
- meet the line. The problem disipates as the arc approaches multiples of
- 90 degrees and is at its worst at (multiples of 90) - 45 degrees.
-
- I am developing a graphical editor and determining the end points of
- arcs is an absolute necessity. Any help would be greatly appreciated.
-
- 270
-