-
Notifications
You must be signed in to change notification settings - Fork 96
/
bracket.sas
65 lines (60 loc) · 1.38 KB
/
bracket.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
%macro bracket(
x0, y0,
x1, y1,
thickness,
orient=, /* L, R, U, D */
color=black,
line=1,
width=1
);
length function $8;
orient="%upcase(&orient)";
w = &thickness;
drop w cx cy;
select(orient);
when('L') do;
%arc(&x0, &y0-w, 90, 90, w, &color, &line, &width);
cx = &x0 - 2*w;
cy = (&y0 + &y1)/2;
%line(&x0-w, &y0-w, &x0-w, cy+w, &color, &line);
%arc(cx, cy+w, 0, -90, w, &color, &line, &width);
%arc(cx, cy-w, 0, 90, w, &color);
%line(cx+w, cy-w, &x1-w, &y1+w, &color, &line);
%arc(&x1, &y1+w, 180, 270, w, &color, &line, &width);
end;
when('R') do;
%arc(&x0, &y0-w, 0, 90, w, &color, &line, &width);
cx = &x0 + 2*w;
cy = (&y0 + &y1)/2;
%line(&x0+w, &y0-w, &x0+w, cy+w, &color, &line);
%arc(cx, cy+w, 180, 90, w, &color, &line, &width);
%arc(cx, cy-w, 90, 90, w, &color, &line, &width);
%line(cx-w, cy-w, &x1+w, &y1+w, &color, &line);
%arc(&x1, &y1+w, 0, -90, w, &color, &line, &width);
end;
otherwise;
end;
%mend;
%macro arcpie(cx, cy, ang, rot, rad, color);
x=&cx;
y=&cy;
angle=∠
rotate=&rot;
size=&rad;
line=0;
function = 'PIE ';
%if %length(&color) %then color="&color";;
output;
%mend;
%macro line(x1, y1, x2, y2, color, line);
x=&x1;
y=&y1;
%if %length(&color) %then color="&color";;
line = &line;
function = 'MOVE ';
output;
x=&x2;
y=&y2;
function = 'DRAW ';
output;
%mend;