File: filledring.pcm

package info (click to toggle)
extrema 4.3.6-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 19,212 kB
  • ctags: 6,452
  • sloc: cpp: 86,428; sh: 8,229; makefile: 814
file content (49 lines) | stat: -rw-r--r-- 1,430 bytes parent folder | download | duplicates (3)
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
! This script will draw two circles and fill the region between them
!
! OUTER_RADIUS = outer circle radius
! INNER_RADIUS = inner circle radius
! NPTS = number points used to draw circles
! FILLCOLOR = area fill color name
!
! set up circle parameters and fill pattern
!
OUTER_RADIUS = ?1                ! make scalar
INNER_RADIUS = ?2                ! make scalar
FILLCOLOR = string(?3)           ! make color name string variable
NPTS = ?4                        ! make scalar
!
! Generate the data for the circles
!
GENERATE THETA 0,,360 NPTS       ! make temporary vectors
XTEMP = OUTER_RADIUS*COSD(THETA) !
YTEMP = OUTER_RADIUS*SIND(THETA) !
!
! append in reverse order
!
XTEMP[NPTS*2:NPTS+1:-1] = INNER_RADIUS*COSD(THETA)
YTEMP[NPTS*2:NPTS+1:-1] = INNER_RADIUS*SIND(THETA)
YTEMP = YTEMP*(ABS(YTEMP)>1.E-5)
XTEMP[2*NPTS+1] = XTEMP[NPTS]
YTEMP[2*NPTS+1] = YTEMP[NPTS]
!
! Draw the circles and fill
!
SET
 AREAFILLCOLOR FILLCOLOR
 PLOTSYMBOL 0                    ! no plotting symbol
 AUTOSCALE COMMENSURATE          ! choose axis autoscaling type

GRAPH XTEMP YTEMP                ! plot data with axes
SET
 AREAFILLCOLOR 0                 ! turn off area fill color
 CURVECOLOR FILLCOLOR

GRAPH\OVERLAY XTEMP YTEMP        ! to get rid of the outline color
SET
 CURVECOLOR BLACK
 LINEWIDTH 1
 
GRAPH\OVERLAY OUTER_RADIUS*COSD(THETA) OUTER_RADIUS*SIND(THETA)
GRAPH\OVERLAY INNER_RADIUS*COSD(THETA) INNER_RADIUS*SIND(THETA)