forked from friendly/SAS-macros
-
Notifications
You must be signed in to change notification settings - Fork 0
/
arc.sas
29 lines (27 loc) · 1022 Bytes
/
arc.sas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
*-------------------------------------------------------------;
* Draw a circular arc, given center, radius, angle, rotation ;
*-------------------------------------------------------------;
%macro arc( cx, /* X-coordinate of center */
cy, /* Y-coordinate of center */
ang, /* Starting angle (degrees) of arc */
rot, /* Degrees of rotation of arc */
radius, /* Radius of arc (>0) */
color, /* Color of line */
pattern, /* Line pattern (1..32) */
width ); /* Width of line (1..5) */
drop radians a ang rot;
radians = (2 * 3.1415927) / 360;
ang = &ANG * radians;
rot = ang + &ROT * radians;
color = "&color";
line = &pattern;
size = &width;
do a = ang to rot by 0.05;
x = &cx + (&radius * cos(a));
y = &cy + (&radius * sin(a));
if a=ang then function = 'move ';
else function = 'draw ';
* function = 'draw ';
output;
end;
%mend;