version 6.0
DR Draw arc (area; start; length; radiusH; radiusV; centerH; centerV) Longint
| Parameter | Type | Description | |
| area | Longint | 4D Draw area | |
| start | Integer | starting angle in degrees | |
| length | Integer | Length of Arc in degrees | |
| radiusH | Number | Horizontal radius | |
| radiusV | Number | Vertical radius | |
| centerH | Number | Horizontal location of arc center | |
| centerV | Number | Vertical location of arc center | |
| Function result | Longint | Object ID |
Description
The command DR Draw arc creates a new arc in area and returns the object's ID. The new arc is created with the default line and fill attributes.
start is the beginning of the arc in degrees. start is the point that begins the arc, moving counter-clockwise from 0°. start must be less than 360°.
length is the length of the arc in degrees. The end of an arc is start + length % 360. Arcs have a maximum length of 359°.
radiusH and radiusV are the horizontal and vertical radii of the arc expressed in base units. As the basis of an arc is an oval, not necessarily a circle, these two numbers can be different. If radiusH equals radiusV, the arc is a portion of a circle.
centerH and centerV are the horizontal and vertical coordinates of the center of the arc with respect to the origin and are expressed in base units. Use the DR Base to scale function to convert from base units to scale units.
The following diagram illustrates the parameters that describe an arc:
Example
The following example creates ninety 4° arcs. Each arc uses a different color but the same coordinates for the center. The effect is a circle filled with a rainbow gradient. This example requires a color monitor set to 8-bit depth.
For ($i ;0;89) DR SET FILL ATTRIBUTES (Area;-2;3;DR Index to color ($i + 17)) $ID := DR Draw arc (Area;$i * 4;4;2;2;2;2) End for
See Also
DR GET ARC SPECS, DR SET ARC SPECS.