An Interactive Program For Doing Fry Strain Analysis On The Macintosh Microcomputer

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/234572983

An Interactive Program for Doing Fry Strain Analysis on the Macintosh


Microcomputer

Article  in  Journal of Geological Education · May 1989


DOI: 10.5408/0022-1368-37.3.171

CITATIONS READS
8 115

1 author:

Declan G. De Paor
Old Dominion University
112 PUBLICATIONS   2,034 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Independent project View project

GEOPATH Research Project on Accessible Field Learning Experiences in the Geosciences View project

All content following this page was uploaded by Declan G. De Paor on 23 December 2016.

The user has requested enhancement of the downloaded file.


An Interactive Program for Doing
Fry Strain Analysis on the Macintosh Microcomputer
Declan G. De Paor

Department of Earth and Planetary Sciences


Johns Hopkins University
Baltimore, Maryland 21218

ABSTRACT sedimentary fabric is a constraint (see discussion in De Paor


This paper describes a Macintosh application for per- 1988). Recently, Erslev (1988) has described a modified
forming Fry's (1979) technique of strain analysis either as a method of Fry analysis which has remarkably improved resolu-
research tool or teaching exercise. To acquire data for the tion and definition. However, readers should note that Erslev's
program, an oriented section is cut through a rock technique requires more data (and more work) than mere mea-
specimen and the centers of deformed objects are located. surement of center-to-center distances. The shapes of all ex-
The x,y coordinates of these centers are fed into a Macin- clusion zones surrounding centers must be defined in order to
tosh™ microcomputer using either a mouse, keyboard, calculate normalized center-to-center distances.
digitizing tablet, or pre-existing data file. All center-to-center Since the Fry technique is easily applied without mathemati-
distances are calculated and plotted by the computer in a cal intricacies or computing aids, it may seem strange that one
matter of seconds, and the user is then given the oppor- should feel the need to automate the procedure beyond the
tunity to fit a strain ellipse to the characteristic central hole low-resolution level presented in Fry (1979). My main motiva-
in the Fry plot. The goodness-of-fit of the ellipse is checked tion in doing so was to add flexibility in the interpretation of
by a novel technique. The center-to-center vectors are re- results. The computer program presented here speeds up the
stored to their pre-strain condition, and their distribution is procedure of calculating and plotting center-to-center distan-
evaluated for compatibility with the assumptions of the Fry ces (see Simpson, 1988), but much more importantly, it allows
method. the user to try various best-fit strain ellipses by means of inter-
The program is compiled from source code using the active graphics and provides an objective goodness-of-fit test
Microsoft™ BASIC compiler and conforms to the standard for the chosen strain ellipse.
Macintosh user interface. A diskette containing compiled Because of the graphical and interactive nature of the task,
code, a user manual, and a data set from the archives of E. the program is designed as a Macintosh™ application. The
Cloos is available on request. standard Macintosh user interface is adhered to, so a variety of
options are constantly available from the menubar. The pro-
Key words: Computer assisted instruction; structural geol- gram never "hangs," even in the hands of a novice. This makes
ogy, problems - geomathematical. it suitable for undergraduate laboratory use.

Data Input
Introduction Data are collected from a plane face or saw-cut of an ori-
One of the most successful and widely applied methods of ented specimen. If object centers are immediately obvious,
geological strain analysis is the center-to-center technique of they can be photographed and their cartesian coordinates can
Fry (1979). Commonly, objects (pebbles, ooids, porphyro- easily be determined manually or with a digitizer. Alternatively,
blasts, and so forth) in a rock have definable centers, and there the centers can be traced or xeroxed onto transparent paper. If
are zones around each center that exclude other objects by object centers are not visible but peripheral outlines are, then
physical or chemical processes. These exclusion zones may centroids must be guessed or calculated (see, for example,
be visible, as in the case of an object's physical periphery, or in- Zarkos and Rogers, 1987). For the purpose of this paper, an
visible, as in the case of a chemically depleted region around a oolitic limestone from the Ashton area, central Appalachians,
metamorphic nucleation site. In either case, if exclusion zones was chosen from the archives of E. Cloos (Figure 1: see Cloos
are roughly equal in size and if they touch but do not overlap, 1947, 1971). In it, object centers are clearly defined by con-
the distribution of object centers will be anti-clustered, or centric growth rings.
"spaced out." If the shapes of exclusion zones are equant (or Center coordinates can be entered into the computer in a
elongate but randomly oriented), the distribution of centers will variety of ways. Using either a word processor such as Mac-
also be equant or "isotropic." After deformation, their spatial Write™, or a digitizing tablet such as MacTablet™, they can be
statisitics record the amount of strain endured by the rock. This stored in simple x,y format in an ASCII text file which is later
record is revealed by plotting center-to-center distances as a opened when the Fry analysis program is run. Alternatively, the
function of direction. If each center-to-center vector is recorded 'new file' option can be chosen and a file name specified for
by a dot marking its tip after translation of its tail to an arbitrary storing the data. (A 'save' option is not required, since new files
origin, a vacant area or hole is observed about the origin. The are automatically saved.) Center coordinates are fed into this
hole reflects the cumulative effects of all deformed exclusion new file using the mouse, which controls a high-resolution cur-
zones. If the assumptions of initial anti-clustering and isotropy sor (crosshairs) whose screen coordinates are continuously
hold, the shape of this hole yields the finite strain ellipse. monitored and echoed. Thus mouse and monitor serve as an
The advantages of the Fry technique are its ease of applica- integrated digitizing tablet (Figure 2). One way to enter the data
tion and its suitablility for a wide variety of objects and deforma- is to measure center coordinates on graph paper, move the
tion conditions (see Hanna and Fry, 1979; Ramsay and Huber, mouse until the appropriate coordinates are echoed on the
1983). Unlike the Rf/<J> technique, it can handle such phenom- screen, and then click the mouse button. Alternatively, for
ena as non-elliptical object shapes and deformation by pres- casual demonstration purposes, a teacher may tape an acetate
sure solution (Ramsay, 1967; Onasch, 1986; Bhattacharyya xerox of the data against the computer monitor and view the
and Longiaru, 1986). However, the assumption of no primary cursor through it, clicking the mouse under each visible object
Journal of Geological Edi :ation, 1989, v. 37, p. 171
Fry Strain Analysis on the Macintosh Microcomputer

Figure 1 Oolitic limestone from Ashton, central Appalachians. Height of photo = 5 cm. Concentric structure clearly
identifies the center of each object. Only part of the field analyzed in this paper is shown. From the Archives of the late
Prof. E. Cloos, Johns Hopkins University.
center. At any stage, mistakes in inputting data can be cor-
rected (both on the screen and in the data file) by using an
UNDO command.
To speed program execution, center-to-center distances
are calculated and stored during the natural pauses that occur £ Fi l e Pr o ced u r e Op t i o n s I AiiX
while the user locates subsequent centers. The number of
centers and of center-to-center calculations are echoed on the
screen. The program is dimensioned for 100 centers, which
ID
generates 9,900 center-to-center calculations. Readers may
wish to increase this number if they have enough memory avail-
able, but they will probably find that the Fry plot doesn't be-
come clearer, only darker! To end data input, the user simply
selects another menu option. At any stage, the current data set e>
can be abandoned, the pensize changed, axes displayed or
hidden, and so on, by toggling the appropriate menu item.
After plotting center-coordinate data, PANFRY (Eoint
AMticlustering) is selected from the menu. This results in the
display of the familiar plot of all center spacings as a function of
direction (Figure 3). By toggling the PANFRY option, the plot of
center coordinates (Figure 2) is returned so that the user can
study the sources of spatial anticlustering or identify maverick
points, for example. Another menu option, termed STIRFRY
(STandardized Initial Radii) is included for future implementa-
tion of Erslev's (1988) method of center-to-center analysis.
The FRENCHFRY menu option (fitting Radial Extensions
Mear Central Hole) generates a centrosymmetric line which
tracks the cursor and is refreshed whenever the latter is moved
(the 'stick/ line familiar to MacPaint™ users). By clicking the
mouse button, the user positions the line, first along the desired
maximum and then the minimum extension direction in the
central hole, after which the computer calculates and displays

Figure 2 (right). Appearance of computer screen during


plotting of center coordinates. Clicking the mouse marks a
point at the cross-hair location and places its coordinates
in a data file (cursor changes to wristwatch while writing to
file). Cursor location is echoed in parentheses at bottom.
Number of points digitized and calculations required are
shown. Menubar at top is always active. Options include 93 pts., 8556 calcs. (-45,+43)
UNDO under the EDIT menu, for correcting input mistakes.
Journal of Geological Education, 1989, v. 37, p. 172
Fry Strain Analysis on the Macintosh Microcomputer

Op t i o n s im

Figure 3. Center-to-center (PANFRY) plot for the Ashton data. Note the characteristic central hole. The strain ratio and
axial orientation are echoed at top left.

the consequent strain ellipse (Figure 3: the computer pays at- boundary conditions are unavoidable in Fry analysis; the only
tention to the minimum axial magnitude only, since axial direc- good boundary to the field of inspection is a scaled-up strain
tions are constrained to be mutually perpendicular). Axial ellipse, which is unknown. However, initial distribution anti-
lengths, orientations, and ratios are echoed on the screen clustering is marked by a sudden jump in the histogram reflect-
(Figure 3, top left). A menu option permits the selected ellipse's ing the most closely spaced points. Maverick points that lie
axes to be shown or hidden. If the first choice of ellipse is not inside the strain ellipse plot in isolation in the gap on the left of
acceptable to the user's eye, the FRENCHFRY option can be the bulk of the histogram data. The goodness-of-fit is improved
reselected and the maximum and minimum extensions ad- by minimizing the number of mavericks and maximizing the fre-
justed as often as necessary. quency jump for the smallest center-to-center spacings (com-
To test the fit of a strain ellipse to the data set, the pare Figures 4 and 5). Toggling the GOODNESS-OF-FIT menu
GOODNESS-OF-FIT menu option is selected. In response, the option removes the frequency histogram from the screen, leav-
computer calculates the reciprocal strain ratio, retrodeforms all ing the user free to try for a better fit.
center spacings, and then plots a histogram of initial center-to- Once a satisfactory strain ellipse has been fitted to the data
center distances (Figure 4). In evaluating this histogram, the (or indeed at any previous stage), results can be output to a
longest center-to-center distances on the right hand side printer or saved as a MacPaint™ file using the PRINT menu op-
should be ignored, for they reflect the rectangle obtained by tion. The user can modify the appearance of the plot, add
retrodeforming the photograph in Figure 1. Such bad labels, figure captions, etc., using MacPaint™ software.
Journal of Geological Education, 1989, v. 37, p. 173
Fry Strain Analysis on the Macintosh Microcomputer

£ Hi e PnyvAKhne Opt ions Uiil

Figure 4. Evaluating the strain ellipse using a histogram of restored center-to-center distances. A good choice of ellipse
leads to a sharp peak on the left. See text for explanation.

Discussion The Macintosh computer is ideally suited to interactive


The Fry technique is easily applied to a wide variety of data graphics input and output operations. Programming the Macin-
sets, but it is not always a simple matter to interpret the results. tosh is radically different from programming other computers;
Central holes are often vaguely defined owing to cut effects consequently, much of the code listed below may appear un-
(Longiaru and Bhattacharyya, 1985; Crespi, 1986). They may familiar even to experienced programmers. Figure 6 illustrates
be far from elliptical and may contain maverick points. Center how to incorporate the Macintosh user interface into a BASIC
spacings greater than the minima may reflect superposed program. The current application has been tested by my most
fabrics, as in the cases discussed by Lacassin and van den notorious student hackers and will not hang or crash under nor-
Driessche (1983). Field-of-view boundary effects have to be mal use (provided that the necessary Microsoft files 'ToolLib'
avoided, a point emphasized by Fry (1979, p.100). Conse- and 'bas.rl' are on disk and that adequate memory is available).
quently, any totally automated best-fit procedure is likely to It is possible to generate some undesirable effects, for exam-
yield spurious results. The solution presented here is to rely on ple, by changing pensize in between the PLOTting and
the geologist's eye to fit an ellipse to the central hole and then UNDOing of a point. Trapping all such events would have
use the computer to evaluate the fit objectively by means of a restricted user creativity and added unwarranted length to the
histogram of retrodeformed center spacings. A best-fit solution code. The core of the program can be translated for other
is approached iteratively. Although the data in Figure 1 appear hardware, but the availability of an interactive cursor (such as
to be of high quality, the strain field is not in fact homogeneous. the Tektronix™ GIN option) is essential. IBM PC users should
When 100 points were selected from another part of this note that an alternative program is available commercially from
photograph, the resultant best-fit ellipse was almost circular. Rockware Inc. at a cost of $150.
Practicing the fitting routine presented here leads to a better ap- A diskette containing source code, compiled code, all
preciation of the reliability of one's strain data. necessary library files, Cloos's Ashton data, and user manual
Journal of Geological Education, 1989, v. 37, p. 174
Fry Strain Analysis on the Macintosh Microcomputer

Figure 5. Repetition of the FRENCHFRY ellipse-fitting routine using a purposefully poor choice. Note flatness of his-
togram and absence of peak to the left.

text is available on request to those who send the author a De Paor, D.G., 1988, Rf/cf* strain analysis using an orientation
blank diskette or $5 and a stamped addressed parcel. In order net: Journal of Structural Geology, v. 10, p. 323-333.
to avoid viruses, I will accept unused diskettes only. Erslev, E.A., 1988, Normalized center-to-center strain analysis
of packed aggregates: Journal of Structural Geology, v. 10,
Acknowledgements p. 201-210.
Version 1.0 of this program comprised part of a short Fry, N., 1979, Random point distributions and strain measure-
course on Strain and Kinematic Analysis, presented by C. ment in rocks: Tectonophysics, v. 60, p. 806-807.
Simpson and D. De Paor in Tempe, Arizona, in October 1987.
Hanna, S.S., and Fry, N., 1979, A comparison of methods of
References Cited strain determination in rocks from southwest Dyfed
(Pembrokshire) and adjacent areas: Journal of Structural
Bhattacharyya, T., and Longiaru, S., 1986, Ability of the Fry
Geology, v. 1, p. 155-162.
method to characterize pressure-solution deformation -
Lacassin, R., and van den Driessche, J., 1983, Finite strain
Discussion: Tectonophysics, v. 131, p. 199-200.
determination of gneiss: application of Fry's method to por-
Cloos, E., 1947, Oolite deformation in the South Mountain
phyroid in the southern Massif Central (France): Journal of
Fold, Maryland: Geological Society of America Bulletin, v.
58, p. 843-918. Structural Geology, v. 5, p. 245-254.
Longiaru, S., and Bhattacharyya, T., 1985, Computer based ex-
Cloos, E., 1971, Microtectonics along the Western Edge of the
perimental studies of the Fry method of strain analysis on 2-
Blue Ridge, Maryland and Virginia: Baltimore, Johns Hop-
and 3-dimensional grain populations: Geological Society of
kins University Press, 234 p.
Crespi, J.M., 1986, Some guidelines for practical application of America Abstracts with Programs, v. 17, p. 646.
Fry's method of strain analysis: Journal of Structural Geol- Ramsay, J.G., 1967, Folding and Fracturing of Rocks: New
ogy, v. 8, 799-808. York, McGraw-Hill, 568 p.

Journal of Geological Education, 1989, v. 37, p. 175


Fry Strain Analysis on the Macintosh Microcomputer
Appe ndix

'Program Fry Analysis, Version 2.0


'Compile with the Microsoft™ BASIC compiler
'Microsoft™ ToolLib and bas.rl files must be in folder
'Alerts file is optional. May be removed by experienced users.

CLEAR:'clear memory
ON ERROR GOTO errorhandler:'trap errors
ChangeCursor 4:'wristwatch
LIBRARY "ToolLib":'open subroutine library
OpenResFile "Alerts",ref%: 'open MS BASIC™ resource file
WINDOW CLOSE 1:'disable default window & menubar
FOR i = 1 TO 5: MENU 1,0,0,"": NEXT i

DIM x(100),y(100),dx(10000),dy(10000): 'adjust to fit RAM


DIM dxinv(10000),dyinv(10000),Sinv%(10000)
DIM D(2,2), Dinv(2,2), image%(20000),freq(10000)

'initialize variables'
ref% = 0: but% = 0
pi = 4*ATN(1): size$ = "1"
axisflag = 1 :oldpen% = 1 :penmag% = 1
title$ =" Untitled ":datafile$ = "Untitled"
xscreen% = 640:yscreen% = 470
xcenter% = .5*xscreen%-7
ycenter% = .5*yscreen%-20
echox% = xcenter% + 20
echoy% = 2*ycenter%-10
CALL PENMODE (10):'pen XOR's with screen

WINDOW 2,"",(30,70)-(480,295),2: 'credits window


TEXTSIZE (24): TEXTFACE (8)
PRINT: PRINT: PRINT " FRY ANALYSIS"
TEXTSIZE (12):TEXTFACE (1)
PRINT: PRINT" Version 2.0. Copyright 1988. Declan De Paor,"
PRINT" The Johns Hopkins University. All rights reserved."
TEXTFACE (0)
TEXTSIZE (10): PRINT "Click & drag the mouse to select menu";

now = TIMER: 'pause


WHILE TIMER-now<2
WEND
FOR color% = 1 TO 5000 STEP 16
radius = radius -l-1/50
CIRCLE (500*RND,300*RND),radius*RND,color%
NEXT color%
WINDOW CLOSE 2: 'end credits
CALL INITCURSOR:'pointer

'set-up menu
MENU 1,0,0,"File"
MENU 1,1,1,"New"
cmdKey 1,1,"N"
MENU 1,2,1,"Open"
CmdKey 1,2/0"
MENU 1,3,1/Print"
CmdKey 1,3/P"
( Quit ) MENU 1,4,1,"Quit"
CmdKey 1,4/Q"
Figure 6. Outline of event-trapping progra m structure.
MENU 2,0,0,"Procedure"
MENU 2,1,1/Plot centers"
Ramsay, J.G., and Huber, M.I., 1983, The Techniques of MENU 2,2,1,"STIR FRY"
MENU 2,3,1/FRENCH FRY"
Modern Structural Geology, Volume 1: Strain Analysis, Lon-
don, Academic Press, 30 p. MENU 3,0,0,"Options"
Simpson, C., 1988, Analysis of two-dimensional finite strain, in MENU 3,1,1,"Show axes"
S. Marshak and G. Mitra, editors, Basic Methods of Struc- MENU 3,2,1/Pensize"
tural Geology, Part II, Special Topics: Garden City, New Jer- MENU 3,3,1/PANFRY"
sey, Prentice Hall, p. 333-359. MENU 3,4,0, "Show ellipse axes"
MENU 3,5,0,"Goodness of fit"
Zarkos, R.W., and Rogers, G.F., 1987, A complete algorithm for
computing area and center of gravity for polygons: Com- MENU 4,0,1, "Mac I.D."
puters and Geoscience, v. 13, p. 561. MENU 4,1,1, "Mac, Mac + , SE"
MENU 4,2,1, "Macintosh II"

Journal of Geological Education, 1989, v. 37, p. 176


Fry Strain Analysis on the Macintosh Microcomputer
MENU 5,0,0,"Edit" MENU 5,0,0
MENU 5,1,0,"Undo" RETURN: 'to File
CmdKey 5,1,"Z'
reinit:
'trap events FOR i = 1 TO numpoints
ON MENU GOSUB menucheck: MENU ON x(i) = 0
idle: y(i) = 0
next i
GOTO idle FOR i = 1 TO k
dx(i) = 0
menucheck: dy(i) = 0
MENU: 'reset selected item NEXT i
MENU ON i=0
ON MENU(O) GOSUB menu1,menu2,menu3,menu4,menu5 k=0
IF undo$ = "chosen" THEN undo$ = "": GOTO returnfromundo flag = 0
RETURN: 'to point of menu call goodflag = 0
menu1:'file RETURN: 'to New or Open
MENU 5,0,0: 'disable Undo
ON MENU(1) GOSUB menul 1 ,menu12,menu13,menu14 missingfile:
MENU 2,1,1 CLOSE
RETURN: 'to menucheck OPEN title$ FOR OUTPUT AS #1
CLOSE #1

RESUME: 'resume Open


menul 1: 'New
GOSUB reinit: 'reinitialize some variables
WINDOW CLOSE 1 editor:
WINDOW 2,"", (50,30)-(300,100),-2 PRINT message$: 'user inputs new or existing datafile name
message$ = "Enter new file name:" EDIT FIELD 1, title$,(5,30)-(250,45)
GOSUB editor BUTTON 1,1,"O.K.", (200,49)-(250,67)
WINDOW CLOSE 2 hanginthere:
WINDOW 1,title$, (0,40)-(xscreen%,yscreen%) userresponse = DIALOG (0)
IF userresponse = 0 OR userresponse = 5 THEN hanginthere
'hide reference axes and ellipse axes in case they're showing 'event other than waiting or typing detected'
IF axes$ = "Hide axes" THEN axes$ = "Show axes":GOSUB title$ = EDIT$(1)
MENU31 RETURN
IF eaxes$ = string2$ THEN eaxes$ = string 1 $: GOSUB menu34
CALL MOVETO (echox%,echoy%) 'return to New or Open routine
MENU 2,0,1: 'enable menu selection
MENU 3,0,1 menu13:= 'Print
alerterS "Type command-shift-4 (or 3) for screen dump to
IF eaxes$ = string1$THEN MENU 3,4,0 Imagewriter (or MacPaint file)"
MENU 5,0,0 GET (92,0)-(409,158),image%
RETURN: 'to File Alert ref%,2,300,but%,alerterS
'wait for response
menu 12: 'Open WHILE but% = 0
GOSUB reinit WEND
WINDOW CLOSE 1 PUT (92,0),image%,OR
CLOSE RETURN: 'to File
WINDOW 2, "Open existing file",(50,30)-(300,100),-2
message$ = "Enter file name:" menu14:'quit
GOSUB editor FOR i = 1 TO 4
WINDOW CLOSE 2 WINDOW CLOSE i
WINDOW 1,title$, (0,40)-(xscreen%,yscreen%) NEXT i
ChangeCursor 4: 'mimic original input sequence' CloseResFile ref%
ON ERROR GOTO missingfile CLOSE
OPEN title$ FOR INPUT AS #1 END: 'point of no return!
ON ERROR GOTO errorhandler
WHILE NOT EOF(1) AND i < 101 menu2:'Procedure
'get points and plot on screen MENU 5,0,0: 'disable Undo
i=i+ 1 ON MENU(1) GOSUB menu21,menu22,menu23
numpoints = i RETURN: 'to menucheck
INPUT #1,x(i),y(i)
CALL MOVETO (x(i),y(i)) menu21:'Plot centers
CALL LINE (0,0) 'avoid superimposing plots until File is selected again
'calculate center-to-center distances MENU 2,1,0
FORj= 1 T O M 'prompt user on how to input data
dx(k) = x(i)-x(j) alerterS = "Enter data by clicking mouse"
dy(k) = -y(i)+yO) GET (92,0)-(409,158),image%
dx(k + 1) = -dx(k) Alert ref%,2,300,but%,alerterS
dy(k + 1) = -dy(k) 'wait for response
k= k+2 WHILE but% = 0
NEXT j WEND
WEND
CLOSE PUT (92,0),image%,OR: 'refresh screen
CALL INITCURSOR MENU 3,1,1: 'activate relevant menu items
CALL MOVETO (echox%,echoy%) MENU 3,3,1
MENU 2,0,1:'enable menu selection CLOSE: 'incase file was left open
MENU 3,0,1 OPEN titleS FOR OUTPUT AS #1
MENU 3,4,0 i= 0

Journal of Geological Education, 1989, v. 37, p. 177


Fry Strain Analysis on the Macintosh Microcomputer
WHILE i < 101: 'limit input to range of arrays PRINT "Click on long axis ";
returnfromundo: WHILE MOUSE(O) < 0
'prevent Undoing beyond starting point 'while mouse is down, draw flashing long axis
MENU 5,0,1 dx1 =MOUSE(1)-xcenter%: dy1 = MOUSE(2)-ycenter%
IF i < 1 THEN MENU 5,1,0 ELSE MENU 5,1,1 CALL MOVETO (xcenter% + dx1 ,ycenter% + dy 1)
TEXTSIZE (9) CALL LINETO (xcenter%-dx1,ycenter%-dy1)
CALL MOVETO (10,echoy%) 'repetition causes flashing when penmode is XOR
PRINT "No. points = ";i;"; No. calculations = ";k; CALL LINETO (xcenter%+dx1,ycenter% + dy1)
ChangeCursor 3: 'cursor = crosshairs' WEND
'when mouse is released, draw long axis
'Wait for mouse event: echo mouse location dx1 = MOUSE(5)-xcenter%
WHILE MOUSE(0) = 0 dy1 = MOUSE (6)-ycenter%
x= MOUSE(1 )-xcenter% CALL MOVETO (xcenter% + dx1 ,ycenter%+dy 1)
y = -MOUSE(2) +ycenter% CALL LINETO (xcenter%-dx1,ycenter%-dy1)
CALL MOVETO (echox%,echoy%) S1= SQR(dx1*dx1 +dy1*dy1)
PRINT"("; I F d x I o O THEN phi = -ATN (dy1/dx1) ELSE phi =-pi/2
PRINT USING " + # # # . # "; x; 'dx1,dy1,S1,phi are coords, semilength, & orientation of long axis
PRINT","; LOCATE 1,1
PRINT USING " + # # # . # "; y;
PRINT")"; 'same for short axis
WEND: 'MouseUp: plot datum location and record PRINT "Now click on short axis ";
i=i+ 1 WHILE MOUSEJO) < 0
numpoints = i dx2 = MOUSE(1 )-xcenter%
x(i) = MOUSE(5) dy2 = MOUSE(2)-ycenter%
y(i) = MOUSE(6) CALL MOVETO (xcenter% + dx2,ycenter% + dy2)
WRITE #1,x(i);y(i) CALL LINETO (xcenter%-dx2,ycenter%-dy2)
CALL MOVETO (x(i),y(i)) CALL LINETO (xcenter% + dx2,ycenter% + dy2)
CALL LINE (0,0) WEND
dx2 = MOUSE(5)-xcenter%
'calculate center-to-center distances dy2= MOUSE(6)-ycenter%
FORj= 1 TOi-1 S2 = SQR(dx2*dx2 + dy2*dy2)
dx(k) = x(i)-xG) CALL MOVETO (xcenter% + dx1 ,ycenter% + dy1)
dy(k) = -y(i)+y(j) CALL LINETO (xcenter%-dx1,ycenter%-dy1)
dx(k + 1) = -dx(k)
dy(k + 1) = -dy(k) truncate S1 etc. to S11 for display
k= k+2 S11 = INT(S1*10)/10
NEXT j S22= INT(S2*10)/10
'usually, this while-wend loop is interrupted by menu event Rs = INT(S11 *10/S22)/10
WEND: 'fall through wend implies number of points 100 Phii = INT (phi*180/pi)
CLOSE #1 LOCATE 1,1
CALL INITCURSOR PRINT "S1 =";S11;", S2 = ";S22;", Rs = ";Rs;", Phi = ";phii;"
MENU 5,0,0: 'disable Undo
RETURN GOSUB ellipse
'return to Procedure 'fix menu item'
eaxes$ = "Show ellipse axes"
menu22:'STIRFRY- Standardized Initial Radii MENU 3,4,1,eaxes$
GET (92,0)-(409,158),image% CALL INITCURSOR
alerter$ = " The STIR FRY option is for implementation of Erslev's" RETURN: 'to Procedure
alerter$ = alerter$-f "technique which is not currently available."
Alert ref%,3,300,but%,alerterS ellipse:
'draw user-determined best-fit ellipse
'wait for response 'D = deformation (gradients) tensor
WHILE but% = 0 D(1,1) = Sl*COS(phi)*COS(phi) + S2*SIN(phi)*SIN(phi)
WEND D(2,2) = S1 *SIN(phi)*SIN(phi) + S2*COS(phi)*COS(phi)
D(1,2)= (S2-S1)*SIN(phi)*COS(phi): D(2,1) = D(1,2)
'refresh screen 'move to perimeter of ellipse
PUT (92fO),image%,OR CALL MOVETO (D(1,1) +xcenter%,D(2,1) +ycenter%)
MENU 2,2,0 'draw ellipse
RETURN: 'to Procedure FOR i = 0 TO 360 STEP 5
alpha = i*pi/180
x = D(1,1 )*COS(alpha) + D(1,2)*SIN(alpha) + xcenter%
'Fitting Radial Extensions Near Central Hole
y= D(2,1)*COS(alpha) + D(2,2)*SIN(alpha) +ycenter%
menu23: 'FRENCHFRY
CALL LINETO (x,y)
ChangeCursor 2: 'cursor = thin crosshairs
CALL LINE(0,0): 'prevents white spots in XOR penmode'
IFeaxes$< >"Hide ellipse axes" THEN skipl
NEXT i
CALL MOVETO (echox%,echoy%)
'wipe previous ellipse axes using correct size pen flag = 1: 'flag indicates that ellipse will need to be wiped
CALL PENSIZE(oldpen%,oldpen%) MENU 3,5,1
GOSUB menu34 RETURN: 'to FRENCHFRY routine
CALL PENSIZE (penmag%,penmag%)
skipl:
menu3: 'Options
IF flag 1 THEN skip2
MENU 5,0,0:'disable Undo
ON MENU(1) GOSUB menu31,menu32,menu33,Menu34,menu35
'wipe previous ellipse RETURN: 'to menucheck
CALL PENSIZE(oldpen%,oldpen%)
GOSUB ellipse menu31:'show/hide reference axes
CALL PENSIZE (penmag%,penmag%) 'toggle menu item
skip2: IFaxes$ = "Hide axes" THEN axes$ = "Show axes" ELSE axes$ =
LOCATE 1,1 "Hide axes"

Journal of Geological Education, 1989, v. 37, p. 178


Fry Strain Analysis on the Macintosh Microcomputer
MENU 3,1,1,axes$ Dinv(2,1) = -D(2,1)/unit
CALL MOVETO (xcenter%,0)
CALL LINE (0,yscreen%) 'retrodeform center-to-center plot
CALL MOVETO (0,ycenter%) 'dxinv.dyinv = retro coords, Sinv% = dist from origin/circle radius
CALL LINE (xscreen%,0) maxSinv% = 0
CALL MOVETO (echox%,echoy%) FORi = OTOk
RETURN: 'to options dxinv(i) = dx(i)*Dinv(1,1) + dy (i)*Dinv(1,2)
dyinv(i) = dx(i)*Dinv(2,1) +dy(i)*Dinv(2,2)
menu32:'Pensize Sinv%(i) = SQR(dxinv(i) ~ 2 + dyinv(i) ~ 2)
'retain oldpensize for screen wiping routines 'monitor maximum center-to-center distance'
oldpen% = penmag% IF Sinv%(i) > maxSinv% THEN maxSinv% = Sinv%(i)
GET (40,0)-(310,110),image%: 'retain screen image 'monitor frequency of center-to-center stretches
freq(Sinv%(ij) = freq(Sinv%(i)) +1
'find out desired pensize NEXT i
WINDOW 2, "Pensize",(50,30)-(300,100) ,-2
PRINT "Enter pensize:" 'construct histogram of retro center-to-center stretches
EDIT FIELD 1, size$,(5,30)-(250,45) FOR i = 0 TO maxSinv%
BUTTON 1,1,"O.K.", (200,49)-(250,67) hist% = -freq(i)
hangabout: response = DIALOG(0) CALL MOVETO (i,echoy%-20)
IF response = 0 OR response = 5 THEN hangabout IF hist% < 0 THEN CALL LINE (0,hist%)
size$ = EDIT$(1) NEXT i
WINDOW CLOSE 2 CALL INITCURSOR
PUT (40,0),image%,OR: 'refresh screen
'disable menu items except for goodness-of-fit: force wipehisto
'convert to integer MENU 1,0,0
penmag% = VAL(size$) MENU 2,0,0
IF penmag% < 1 OR penmag% > 5 THEN penmag% = 1 FOR i = 1 TO 4
CALL PENSIZE (penmag%,penmag%) MENU 3,i,0
CALL MOVETO (echox%,echoy%) NEXT i
RETURN: 'to Options
'monitor menu activity but do not goto menucheck
menu33: 'PANFRY (Point ANticlustering diagram) MENU ON
MENU STOP: 'disable menu during long plots ON MENU GOSUB wipehisto
ChangeCursor 4: 'wristwatch waiting:
FOR i = 1 TO numpoints GOTO waiting
CALL MOVETO (x(i),y(i)) RETURN: 'to options
CALL LINE (0,0)
NEXT i wipehisto:
'sweep through histogram in reverse direction
'draw all center-to-center plot on first call: wipe on next call FOR i = maxSinv% TO 0 STEP -1
FOR i = 1 TO k hist% = -freq(i)
CALL MOVETO (dx(i) +xcenter%,dy(i) +ycenter%) CALL MOVETO (i,echoy%-20)
CALL LINE (0,0) IF hist%<0 THEN CALL LINE (0,hist%)
NEXT i 'reinitialize frequency array for
freq(i) = 0
'erase point at origin NEXT i
CALL MOVETO (xcenter%,ycenter%)
CALL LINE (0,0) 'enable menu
CALL MOVETO (echox%,echoy%) CALL MOVETO (echox%,echoy%)
CALL INITCURSOR MENU 1,0,1
MENU ON MENU 2,0,1
RETURN FOR i = 1 TO 4
'return to Options MENU 3,i,1
NEXT i
MENU34: 'Show/hide ellipse axes
'restore main menu monitoring
'toggle menu item ON MENU GOSUB menucheck
string 1$ = "Show ellipse axes" RETURN: 'to Goodness-of-fit
string2$ = "Hide ellipse axes"
IF eaxes$ = string 1$ THEN eaxes$ = string2$ ELSE eaxes$ = menu4:'Mac I.D.
string 1$ 'select screen size to suit Mac in use
MENU 3,4,1, eaxes$ IF MENU(1) = 1 THEN xscreen% = 506: yscreen% = 295
CALL MOVETO (xcenter%-dx1,ycenter%-dy1) IF MENU(1) = 2 THEN xscreen% = 640: yscreen% = 470
CALL LINETO (xcenter% + dx1,ycenter% + dy1)
CALL MOVETO (xcenter%-dx2,ycenter%-dy2) 'screen center ajusted for window border width
CALL LINETO (xcenter% + dx2,ycenter%+dy2) xcenter% = .5*xscreen%-7
CALL MOVETO (echox%,echoy%) ycenter% = .5*yscreen%-20
RETURN: 'to options echox% = xcenter% + 20
echoy% = 2*ycenter%-10
MENU35:'Goodness of fit'
ChangeCursor 4: 'wrist watch' 'enable other menu selections
MENU STOP MENU 1,0,1: 'no future use of menu 4: prevents chaos!
'given ellipse, determine circle of equal area' MENU 4,0,0,""
det = D(1,1)*D(2,2)-D(1,2)*D(2,1) RETURN: 'to trap events
unit = SQR(det)
Dinv(1,1) = D(2,2)/unit menu5: 'Edit'
Dinv(2,2) = D(1,1)/unit 'Undo is only choice'
Dinv(1,2) = -D(1,2)/unit Undo$ = "chosen"
Journal of Geological Education, 1989, v. 37, p. 179
Fry Strain Analysis on the Macintosh Microcomputer
MENU STOP RETURN: 'to trap events
'note: repetition of point in file will wipe with XOR'
WRITE#1,x(i);y(i) errorhandler:
CALL MOVETO (x(i).y(i)) 'open brand new window in case existing ones are not visible
CALL LINE (0,0) WINDOW 4
'remove point coordinates from arrays' PRINT "error"; ERR;" at line"; ERL
x(i) = 0 INPUT "O.K.";any$
y(i)=o CloseResFile ref%
'remove center-to-center distances from arrays: reset WINDOW CLOSE 4
center-to-center count' CLOSE
F O R j= 1 T O M END:'do not resume
dx(k) = 0
dy(k) = 0
dx(k +1) = 0
dy(k +1) = 0 About the Author
k = k-2 Declan De Paor is Associate Professor of Structural
NEXT j Geology at Johns Hopkins University. He was formerly
i = i-1 Visiting Senior Fulbright Scholar at SUNY, Albany and Lec-
turer at the National University of Ireland. His current inter-
'echo revised count
CALL MOVETO (10,echoy%)
ests include the mathematical theory of deformation,
PRINT "No. points = ";i;"; No. calculations = ";k; computerized structural analysis and section balancing,
MENU ON Phanerozoic tectonics of Ellesmere Island, and Archean
CALL MOVETO (echox%,echoy%) tectonics of the Slave Province.

Journal of Geological Education, 1989, v. 37, p. 180

View publication stats

You might also like