aboutsummaryrefslogtreecommitdiff
path: root/src/graph/PS/drawarc.ps
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2009-09-27 01:53:09 +0000
committerdos-reis <gdr@axiomatics.org>2009-09-27 01:53:09 +0000
commite8f38c351d90d6dea371a9ac15d2c4906bff9910 (patch)
tree97e4ca1d832f393d1540da11e902465f99b22346 /src/graph/PS/drawarc.ps
parenta956f791537aa080285e6437a53fac69ff93b3b6 (diff)
downloadopen-axiom-e8f38c351d90d6dea371a9ac15d2c4906bff9910.tar.gz
Fix SF/2854105
* graph/PS/*.ps: New.
Diffstat (limited to 'src/graph/PS/drawarc.ps')
-rw-r--r--src/graph/PS/drawarc.ps33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/graph/PS/drawarc.ps b/src/graph/PS/drawarc.ps
new file mode 100644
index 00000000..408ed3dc
--- /dev/null
+++ b/src/graph/PS/drawarc.ps
@@ -0,0 +1,33 @@
+% operand stack configuration in order to use psDrawArc:
+% psDrawArc
+% angle2
+% angle1
+% width
+% height
+% y
+% x
+% graphics-context dictionary
+% this draws an arc whose origin is at x, y, and whose width
+% and height specifies the rectangle which encases the arc.
+% Origin is at upper left corner of rectangle.
+% This function uses "scale" to make cricles and ellipses.
+
+/psDrawArc
+ { gsave
+ newpath
+ /sfactor 4 index 4 index div def %% scale factor
+ 1 sfactor scale
+ 6 5 roll %% x on top of stack
+ 3 index 2 div add %% define x origin
+ 6 5 roll %% y on top of stack
+ 6 5 roll %% h on top of stack
+ 2 div add yVal sfactor div %% define y origin
+ 5 4 roll %% w on top of stack
+ 2 div %% define radius
+ 5 3 roll %% a1 a2 on top of stack
+ 1 index add
+ arcn %% draw clockwise arc
+ begin installGC stroke end
+ grestore }
+ def
+