home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume21 / lyap / part02 < prev    next >
Encoding:
Text File  |  1993-10-07  |  54.4 KB  |  1,689 lines

  1. Newsgroups: comp.sources.x
  2. From: rr@sco.com (Ronald Joe Record)
  3. Subject: v21i005:  lyap - Calculate Lyapunov fractals, Part02/03
  4. Message-ID: <1993Oct7.174705.3710@sparky.sterling.com>
  5. X-Md4-Signature: bbc3292fb21ca564513c0b0b9ba39def
  6. Sender: chris@sparky.sterling.com (Chris Olson)
  7. Organization: Sterling Software
  8. Date: Thu, 7 Oct 1993 17:47:05 GMT
  9. Approved: chris@sterling.com
  10.  
  11. Submitted-by: rr@sco.com (Ronald Joe Record)
  12. Posting-number: Volume 21, Issue 5
  13. Archive-name: lyap/part02
  14. Environment: X11
  15. Supersedes: lyapunov-xlib: Volume 17, Issue 48-49
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then feed it
  19. # into a shell via "sh file" or similar.  To overwrite existing files,
  20. # type "sh file -c".
  21. # Contents:  lyap/Makefile.bak lyap/lib/buffer.c lyap/lib/init_color.c
  22. #   lyap/lib/spin.c lyap/lyap.h lyap/lyap.man lyap/params/circle-4
  23. # Wrapped by chris@sparky on Thu Oct  7 12:38:39 1993
  24. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  25. echo If this archive is complete, you will see the following message:
  26. echo '          "shar: End of archive 2 (of 3)."'
  27. if test -f 'lyap/Makefile.bak' -a "${1}" != "-c" ; then 
  28.   echo shar: Will not clobber existing file \"'lyap/Makefile.bak'\"
  29. else
  30.   echo shar: Extracting \"'lyap/Makefile.bak'\" \(15607 characters\)
  31.   sed "s/^X//" >'lyap/Makefile.bak' <<'END_OF_FILE'
  32. X# Makefile generated by imake - do not edit!
  33. X# $XConsortium: imake.c,v 1.65 91/07/25 17:50:17 rws Exp $
  34. X#
  35. X# The cpp used on this machine replaces all newlines and multiple tabs and
  36. X# spaces in a macro expansion with a single space.  Imake tries to compensate
  37. X# for this, but is not always successful.
  38. X#
  39. X
  40. X# -------------------------------------------------------------------------
  41. X# Makefile generated from "Imake.tmpl" and </tmp/IIf.a00830>
  42. X# $XConsortium: Imake.tmpl,v 1.139 91/09/16 08:52:48 rws Exp $
  43. X#
  44. X# Platform-specific parameters may be set in the appropriate <vendor>.cf
  45. X# configuration files.  Site-specific parameters should be set in the file
  46. X# site.def.  Full rebuilds are recommended if any parameters are changed.
  47. X#
  48. X# If your C preprocessor does not define any unique symbols, you will need
  49. X# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
  50. X# "make World" the first time).
  51. X#
  52. X
  53. X# -------------------------------------------------------------------------
  54. X# site-specific configuration parameters that need to come before
  55. X# the platform-specific parameters - edit site.def to change
  56. X
  57. X# site:  $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
  58. X
  59. X# -------------------------------------------------------------------------
  60. X# platform-specific configuration parameters - edit sun.cf to change
  61. X
  62. X# platform:  $XConsortium: sun.cf,v 1.72.1.1 92/03/18 13:13:37 rws Exp $
  63. X
  64. X# operating system:  SunOS 4.1.1
  65. X
  66. X# $XConsortium: sunLib.rules,v 1.7 91/12/20 11:19:47 rws Exp $
  67. X
  68. X# -------------------------------------------------------------------------
  69. X# site-specific configuration parameters that go after
  70. X# the platform-specific parameters - edit site.def to change
  71. X
  72. X# site:  $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
  73. X
  74. X            SHELL = /bin/sh
  75. X
  76. X              TOP = .
  77. X      CURRENT_DIR = .
  78. X
  79. X               AR = ar clq
  80. X  BOOTSTRAPCFLAGS =
  81. X               CC = cc
  82. X               AS = as
  83. X
  84. X         COMPRESS = compress
  85. X              CPP = /lib/cpp $(STD_CPP_DEFINES)
  86. X    PREPROCESSCMD = cc -E $(STD_CPP_DEFINES)
  87. X          INSTALL = install
  88. X               LD = ld
  89. X             LINT = lint
  90. X      LINTLIBFLAG = -C
  91. X         LINTOPTS = -axz
  92. X               LN = ln -s
  93. X             MAKE = make
  94. X               MV = mv
  95. X               CP = cp
  96. X
  97. X           RANLIB = ranlib
  98. X  RANLIBINSTFLAGS =
  99. X
  100. X               RM = rm -f
  101. X            TROFF = psroff
  102. X         MSMACROS = -ms
  103. X              TBL = tbl
  104. X              EQN = eqn
  105. X     STD_INCLUDES =
  106. X  STD_CPP_DEFINES =
  107. X      STD_DEFINES =
  108. X EXTRA_LOAD_FLAGS =
  109. X  EXTRA_LIBRARIES =
  110. X             TAGS = ctags
  111. X
  112. X    SHAREDCODEDEF = -DSHAREDCODE
  113. X         SHLIBDEF = -DSUNSHLIB
  114. X
  115. X    PROTO_DEFINES =
  116. X
  117. X     INSTPGMFLAGS =
  118. X
  119. X     INSTBINFLAGS = -m 0755
  120. X     INSTUIDFLAGS = -m 4755
  121. X     INSTLIBFLAGS = -m 0644
  122. X     INSTINCFLAGS = -m 0444
  123. X     INSTMANFLAGS = -m 0444
  124. X     INSTDATFLAGS = -m 0444
  125. X    INSTKMEMFLAGS = -g kmem -m 2755
  126. X
  127. X      PROJECTROOT = /usr/X11R5
  128. X
  129. X     TOP_INCLUDES = -I$(INCROOT)
  130. X
  131. X      CDEBUGFLAGS = -O
  132. X        CCOPTIONS = -pipe
  133. X
  134. X      ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(STD_INCLUDES)
  135. X       ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(DEFINES)
  136. X           CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
  137. X        LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
  138. X
  139. X           LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  140. X
  141. X        LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) $(LOCAL_LDFLAGS) -L$(USRLIBDIR)
  142. X
  143. X   LDCOMBINEFLAGS = -X -r
  144. X      DEPENDFLAGS =
  145. X
  146. X        MACROFILE = sun.cf
  147. X           RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
  148. X
  149. X    IMAKE_DEFINES =
  150. X
  151. X         IRULESRC = $(CONFIGDIR)
  152. X        IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
  153. X
  154. X     ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
  155. X            $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
  156. X            $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
  157. X
  158. X# -------------------------------------------------------------------------
  159. X# X Window System Build Parameters
  160. X# $XConsortium: Project.tmpl,v 1.138 91/09/10 09:02:12 rws Exp $
  161. X
  162. X# -------------------------------------------------------------------------
  163. X# X Window System make variables; this need to be coordinated with rules
  164. X
  165. X          PATHSEP = /
  166. X        USRLIBDIR = /usr/X11R5/lib
  167. X           BINDIR = /usr/X11R5/bin
  168. X          INCROOT = /usr/X11R5/include
  169. X     BUILDINCROOT = $(TOP)
  170. X      BUILDINCDIR = $(BUILDINCROOT)/X11
  171. X      BUILDINCTOP = ..
  172. X           INCDIR = $(INCROOT)/X11
  173. X           ADMDIR = /usr/adm
  174. X           LIBDIR = $(USRLIBDIR)/X11
  175. X        CONFIGDIR = $(LIBDIR)/config
  176. X       LINTLIBDIR = $(USRLIBDIR)/lint
  177. X
  178. X          FONTDIR = $(LIBDIR)/fonts
  179. X         XINITDIR = $(LIBDIR)/xinit
  180. X           XDMDIR = $(LIBDIR)/xdm
  181. X           TWMDIR = $(LIBDIR)/twm
  182. X          MANPATH = /usr/X11R5/man
  183. X    MANSOURCEPATH = $(MANPATH)/man
  184. X        MANSUFFIX = 1
  185. X     LIBMANSUFFIX = 3
  186. X           MANDIR = $(MANSOURCEPATH)$(MANSUFFIX)
  187. X        LIBMANDIR = $(MANSOURCEPATH)$(LIBMANSUFFIX)
  188. X           NLSDIR = $(LIBDIR)/nls
  189. X        PEXAPIDIR = $(LIBDIR)/PEX
  190. X      XAPPLOADDIR = $(LIBDIR)/app-defaults
  191. X       FONTCFLAGS = -t
  192. X
  193. X     INSTAPPFLAGS = $(INSTDATFLAGS)
  194. X
  195. X            IMAKE = imake
  196. X           DEPEND = makedepend
  197. X              RGB = rgb
  198. X
  199. X            FONTC = bdftopcf
  200. X
  201. X        MKFONTDIR = mkfontdir
  202. X        MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier
  203. X
  204. X        CONFIGSRC = $(TOP)/config
  205. X       DOCUTILSRC = $(TOP)/doc/util
  206. X        CLIENTSRC = $(TOP)/clients
  207. X          DEMOSRC = $(TOP)/demos
  208. X           LIBSRC = $(TOP)/lib
  209. X          FONTSRC = $(TOP)/fonts
  210. X       INCLUDESRC = $(TOP)/X11
  211. X        SERVERSRC = $(TOP)/server
  212. X          UTILSRC = $(TOP)/util
  213. X        SCRIPTSRC = $(UTILSRC)/scripts
  214. X       EXAMPLESRC = $(TOP)/examples
  215. X       CONTRIBSRC = $(TOP)/../contrib
  216. X           DOCSRC = $(TOP)/doc
  217. X           RGBSRC = $(TOP)/rgb
  218. X        DEPENDSRC = $(UTILSRC)/makedepend
  219. X         IMAKESRC = $(CONFIGSRC)
  220. X         XAUTHSRC = $(LIBSRC)/Xau
  221. X          XLIBSRC = $(LIBSRC)/X
  222. X           XMUSRC = $(LIBSRC)/Xmu
  223. X       TOOLKITSRC = $(LIBSRC)/Xt
  224. X       AWIDGETSRC = $(LIBSRC)/Xaw
  225. X       OLDXLIBSRC = $(LIBSRC)/oldX
  226. X      XDMCPLIBSRC = $(LIBSRC)/Xdmcp
  227. X      BDFTOSNFSRC = $(FONTSRC)/bdftosnf
  228. X      BDFTOSNFSRC = $(FONTSRC)/clients/bdftosnf
  229. X      BDFTOPCFSRC = $(FONTSRC)/clients/bdftopcf
  230. X     MKFONTDIRSRC = $(FONTSRC)/clients/mkfontdir
  231. X         FSLIBSRC = $(FONTSRC)/lib/fs
  232. X    FONTSERVERSRC = $(FONTSRC)/server
  233. X     EXTENSIONSRC = $(TOP)/extensions
  234. X         XILIBSRC = $(EXTENSIONSRC)/lib/xinput
  235. X      PHIGSLIBSRC = $(EXTENSIONSRC)/lib/PEX
  236. X
  237. X# $XConsortium: sunLib.tmpl,v 1.14.1.1 92/03/17 14:58:46 rws Exp $
  238. X
  239. XSHLIBLDFLAGS = -assert pure-text
  240. XPICFLAGS = -pic
  241. X
  242. X  DEPEXTENSIONLIB =
  243. X     EXTENSIONLIB = -lXext
  244. X
  245. X          DEPXLIB = $(DEPEXTENSIONLIB)
  246. X             XLIB = $(EXTENSIONLIB) -lX11
  247. X
  248. X        DEPXMULIB = $(USRLIBDIR)/libXmu.sa.$(SOXMUREV)
  249. X       XMULIBONLY = -lXmu
  250. X           XMULIB = -lXmu
  251. X
  252. X       DEPOLDXLIB =
  253. X          OLDXLIB = -loldX
  254. X
  255. X      DEPXTOOLLIB = $(USRLIBDIR)/libXt.sa.$(SOXTREV)
  256. X         XTOOLLIB = -lXt
  257. X
  258. X        DEPXAWLIB = $(USRLIBDIR)/libXaw.sa.$(SOXAWREV)
  259. X           XAWLIB = -lXaw
  260. X
  261. X        DEPXILIB =
  262. X           XILIB = -lXi
  263. X
  264. X        SOXLIBREV = 4.10
  265. X          SOXTREV = 4.10
  266. X         SOXAWREV = 5.0
  267. X        SOOLDXREV = 4.10
  268. X         SOXMUREV = 4.10
  269. X        SOXEXTREV = 4.10
  270. X      SOXINPUTREV = 4.10
  271. X
  272. X      DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
  273. X         XAUTHLIB =  -lXau
  274. X      DEPXDMCPLIB = $(USRLIBDIR)/libXdmcp.a
  275. X         XDMCPLIB =  -lXdmcp
  276. X
  277. X        DEPPHIGSLIB = $(USRLIBDIR)/libphigs.a
  278. X           PHIGSLIB =  -lphigs
  279. X
  280. X       DEPXBSDLIB = $(USRLIBDIR)/libXbsd.a
  281. X          XBSDLIB =  -lXbsd
  282. X
  283. X LINTEXTENSIONLIB = $(LINTLIBDIR)/llib-lXext.ln
  284. X         LINTXLIB = $(LINTLIBDIR)/llib-lX11.ln
  285. X          LINTXMU = $(LINTLIBDIR)/llib-lXmu.ln
  286. X        LINTXTOOL = $(LINTLIBDIR)/llib-lXt.ln
  287. X          LINTXAW = $(LINTLIBDIR)/llib-lXaw.ln
  288. X           LINTXI = $(LINTLIBDIR)/llib-lXi.ln
  289. X        LINTPHIGS = $(LINTLIBDIR)/llib-lphigs.ln
  290. X
  291. X          DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
  292. X
  293. X         DEPLIBS1 = $(DEPLIBS)
  294. X         DEPLIBS2 = $(DEPLIBS)
  295. X         DEPLIBS3 = $(DEPLIBS)
  296. X
  297. X# -------------------------------------------------------------------------
  298. X# Imake rules for building libraries, programs, scripts, and data files
  299. X# rules:  $XConsortium: Imake.rules,v 1.123 91/09/16 20:12:16 rws Exp $
  300. X
  301. X# -------------------------------------------------------------------------
  302. X# start of Imakefile
  303. X
  304. XCC=gcc
  305. X#
  306. X#   @(#) Imakefile 9.3 93/08/03
  307. X#
  308. X#*************************************************************************
  309. X#*                                                                       *
  310. X#*     Copyright (c) 1992-1993                  Ronald Joe Record        *
  311. X#*                                                                       *
  312. X#*  All rights reserved. No part of this program or publication may be   *
  313. X#*  reproduced, transmitted, transcribed, stored in a retrieval system,  *
  314. X#*  or translated into any language or computer language, in any form or *
  315. X#*  by any means, electronic, mechanical, magnetic, optical, chemical,   *
  316. X#*  biological, or otherwise, without the prior written permission of:   *
  317. X#*                                                                       *
  318. X#*              Ronald Joe Record                        (408) 458-3718  *
  319. X#*              212 Owen St., Santa Cruz, California 95062 USA           *
  320. X#*                                                                       *
  321. X#*************************************************************************
  322. X
  323. X#
  324. X#        Imakefile for lyap, by Ron Record
  325. X#
  326. X
  327. X        SUBDIRS = lib
  328. X
  329. X        DEPLIBS = $(DEPXLIB)
  330. X#    Uncomment the following line if your system doesn't support prototypes
  331. X#    PROTODEFINE = -D_NO_PROTO
  332. X#    -DMAPS includes code to support "Function forcing". See lyap.man (-F)
  333. X      MAPDEFINE = -DMAPS
  334. X        DEFINES = $(MAPDEFINE) $(PROTODEFINE)
  335. X       INCLUDES = -I. -Ilib
  336. X         CFLAGS = -O $(DEFINES) $(INCLUDES) $(CDEBUGFLAGS)
  337. XLOCAL_LIBRARIES = lib/libXrr.a $(XLIB)
  338. X  SYS_LIBRARIES = -lm $(NAPLIB)
  339. X           SRCS = lyap.c
  340. X           OBJS = lyap.o
  341. X
  342. Xall::
  343. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  344. X    for i in $(SUBDIRS) ;\
  345. X    do \
  346. X    (cd $$i ; echo "making" all "in $(CURRENT_DIR)/$$i..."; \
  347. X    $(MAKE) $(MFLAGS) 'CDEBUGFLAGS=$(CDEBUGFLAGS)' all); \
  348. X    done
  349. X
  350. Xdepend::
  351. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  352. X    for i in $(SUBDIRS) ;\
  353. X    do \
  354. X    (cd $$i ; echo "depending" "in $(CURRENT_DIR)/$$i..."; \
  355. X    $(MAKE) $(MFLAGS)  depend); \
  356. X    done
  357. X
  358. X PROGRAM = lyap
  359. X
  360. Xall:: lyap
  361. X
  362. Xlyap: $(OBJS) $(DEPLIBS)
  363. X    $(RM) $@
  364. X    $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS)
  365. X
  366. Xsaber_lyap:: $(SRCS)
  367. X    # load $(ALLDEFINES) $(SRCS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  368. X
  369. Xosaber_lyap:: $(OBJS)
  370. X    # load $(ALLDEFINES) $(OBJS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  371. X
  372. Xinstall:: lyap
  373. X    @if [ -d $(DESTDIR)$(BINDIR) ]; then set +x; \
  374. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(BINDIR)); fi
  375. X    $(INSTALL) -c $(INSTPGMFLAGS)  lyap $(DESTDIR)$(BINDIR)
  376. X
  377. Xinstall.man:: lyap.man
  378. X    @if [ -d $(DESTDIR)$(MANDIR) ]; then set +x; \
  379. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(MANDIR)); fi
  380. X    $(INSTALL) -c $(INSTMANFLAGS) lyap.man $(DESTDIR)$(MANDIR)/lyap.$(MANSUFFIX)
  381. X
  382. Xdepend::
  383. X    $(DEPEND) $(DEPENDFLAGS) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
  384. X
  385. Xlint:
  386. X    $(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
  387. Xlint1:
  388. X    $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
  389. X
  390. Xclean::
  391. X    $(RM) $(PROGRAM)
  392. X
  393. Xinstall:: lyap
  394. X    @if [ -d $(DESTDIR) $(BINDIR) ]; then set +x; \
  395. X    else (set -x; $(MKDIRHIER) $(DESTDIR) $(BINDIR)); fi
  396. X    $(INSTALL) -c $(INSTPGMFLAGS)  lyap $(DESTDIR) $(BINDIR)
  397. X
  398. Xinstall.man:: lyap.man
  399. X    @if [ -d $(DESTDIR) $(MANDIR) ]; then set +x; \
  400. X    else (set -x; $(MKDIRHIER) $(DESTDIR) $(MANDIR)); fi
  401. X    $(INSTALL) -c $(INSTMANFLAGS) lyap.man $(DESTDIR) $(MANDIR)/lyap.$(MANSUFFIX)
  402. X
  403. X# -------------------------------------------------------------------------
  404. X# common rules for all Makefiles - do not edit
  405. X
  406. Xemptyrule::
  407. X
  408. Xclean::
  409. X    $(RM_CMD) "#"*
  410. X
  411. XMakefile::
  412. X    -@if [ -f Makefile ]; then set -x; \
  413. X    $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
  414. X    else exit 0; fi
  415. X    $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
  416. X
  417. Xtags::
  418. X    $(TAGS) -w *.[ch]
  419. X    $(TAGS) -xw *.[ch] > TAGS
  420. X
  421. Xsaber:
  422. X    # load $(ALLDEFINES) $(SRCS)
  423. X
  424. Xosaber:
  425. X    # load $(ALLDEFINES) $(OBJS)
  426. X
  427. X# -------------------------------------------------------------------------
  428. X# rules for building in SUBDIRS - do not edit
  429. X
  430. Xinstall::
  431. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  432. X    for i in $(SUBDIRS) ;\
  433. X    do \
  434. X    (cd $$i ; echo "installing" "in $(CURRENT_DIR)/$$i..."; \
  435. X    $(MAKE) $(MFLAGS) DESTDIR='$(DESTDIR)' install); \
  436. X    done
  437. X
  438. Xinstall.man::
  439. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  440. X    for i in $(SUBDIRS) ;\
  441. X    do \
  442. X    (cd $$i ; echo "installing man pages" "in $(CURRENT_DIR)/$$i..."; \
  443. X    $(MAKE) $(MFLAGS) DESTDIR='$(DESTDIR)' install.man); \
  444. X    done
  445. X
  446. Xclean::
  447. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  448. X    for i in $(SUBDIRS) ;\
  449. X    do \
  450. X    (cd $$i ; echo "cleaning" "in $(CURRENT_DIR)/$$i..."; \
  451. X    $(MAKE) $(MFLAGS) RM_CMD='$(RM_CMD)' clean); \
  452. X    done
  453. X
  454. Xtags::
  455. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  456. X    for i in $(SUBDIRS) ;\
  457. X    do \
  458. X    (cd $$i ; echo "tagging" "in $(CURRENT_DIR)/$$i..."; \
  459. X    $(MAKE) $(MFLAGS) TAGS='$(TAGS)' tags); \
  460. X    done
  461. X
  462. XMakefiles::
  463. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  464. X    for i in $(SUBDIRS) ;\
  465. X    do \
  466. X    echo "making Makefiles in $(CURRENT_DIR)/$$i..."; \
  467. X    case "$$i" in \
  468. X    ./?*/?*/?*/?*) newtop=../../../../ sub=subsubsubsub;; \
  469. X    ./?*/?*/?*) newtop=../../../ sub=subsubsub;; \
  470. X    ./?*/?*) newtop=../../ sub=subsub;; \
  471. X    ./?*) newtop=../ sub=sub;; \
  472. X    */?*/?*/?*) newtop=../../../../ sub=subsubsubsub;; \
  473. X    */?*/?*) newtop=../../../ sub=subsubsub;; \
  474. X    */?*) newtop=../../ sub=subsub;; \
  475. X    *) newtop=../ sub=sub;; \
  476. X    esac; \
  477. X    case "$(TOP)" in \
  478. X    /?*) newtop= upprefix= ;; \
  479. X    *) upprefix=../ ;; \
  480. X    esac; \
  481. X    $(MAKE) $${sub}dirMakefiles UPPREFIX=$$upprefix NEWTOP=$$newtop \
  482. X    MAKEFILE_SUBDIR=$$i NEW_CURRENT_DIR=$(CURRENT_DIR)/$$i;\
  483. X    done
  484. X
  485. XsubdirMakefiles:
  486. X    $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak
  487. X    -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then set -x; \
  488. X    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \
  489. X    else exit 0; fi
  490. X    cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR); \
  491. X    $(MAKE) $(MFLAGS) Makefiles
  492. X
  493. XsubsubdirMakefiles:
  494. X    $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak
  495. X    -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then set -x; \
  496. X    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \
  497. X    else exit 0; fi
  498. X    cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR); \
  499. X    $(MAKE) $(MFLAGS) Makefiles
  500. X
  501. XsubsubsubdirMakefiles:
  502. X    $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak
  503. X    -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then set -x; \
  504. X    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \
  505. X    else exit 0; fi
  506. X    cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(UPPREFIX)$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR); \
  507. X    $(MAKE) $(MFLAGS) Makefiles
  508. X
  509. XsubsubsubsubdirMakefiles:
  510. X    $(RM) $(MAKEFILE_SUBDIR)/Makefile.bak
  511. X    -@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then set -x; \
  512. X    $(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \
  513. X    else exit 0; fi
  514. X    cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(UPPREFIX)$(UPPREFIX)$(UPPREFIX)$(UPPREFIX)$(TOP) -DCURDIR=$(NEW_CURRENT_DIR); \
  515. X    $(MAKE) $(MFLAGS) Makefiles
  516. X
  517. Xincludes::
  518. X    @case '${MFLAGS}' in *[ik]*) set +e;; esac; \
  519. X    for i in $(SUBDIRS) ;\
  520. X    do \
  521. X    (cd $$i ; echo including "in $(CURRENT_DIR)/$$i..."; \
  522. X    $(MAKE) $(MFLAGS)  includes); \
  523. X    done
  524. X
  525. X# -------------------------------------------------------------------------
  526. X# dependencies generated by makedepend
  527. X
  528. END_OF_FILE
  529.   if test 15607 -ne `wc -c <'lyap/Makefile.bak'`; then
  530.     echo shar: \"'lyap/Makefile.bak'\" unpacked with wrong size!
  531.   fi
  532.   # end of 'lyap/Makefile.bak'
  533. fi
  534. if test -f 'lyap/lib/buffer.c' -a "${1}" != "-c" ; then 
  535.   echo shar: Will not clobber existing file \"'lyap/lib/buffer.c'\"
  536. else
  537.   echo shar: Extracting \"'lyap/lib/buffer.c'\" \(3470 characters\)
  538.   sed "s/^X//" >'lyap/lib/buffer.c' <<'END_OF_FILE'
  539. X/*************************************************************************
  540. X *                                                                       *
  541. X *  Copyright (c) 1992, 1993 Ronald Joe Record                           *
  542. X *                                                                       *
  543. X *  All rights reserved. No part of this program or publication may be   *
  544. X *  reproduced, transmitted, transcribed, stored in a retrieval system,  *
  545. X *  or translated into any language or computer language, in any form or *
  546. X *  by any means, electronic, mechanical, magnetic, optical, chemical,   *
  547. X *  biological, or otherwise, without the prior written permission of:   *
  548. X *                                                                       *
  549. X *      Ronald Joe Record (408) 458-3718                                 *
  550. X *      212 Owen St., Santa Cruz, California 95062 USA                   *
  551. X *                                                                       *
  552. X *************************************************************************/
  553. X
  554. X#include "libXrr.h"
  555. X
  556. Xvoid
  557. XBufferInPixmap(display, pixmap, contexts, points, col, x, y)
  558. XDisplay *display;
  559. XPixmap pixmap;
  560. XGC *contexts;
  561. Xpoints_t *points;
  562. Xint col, x, y;
  563. X{
  564. X    if (points->npoints[col] == MAXPOINTS)
  565. X    {
  566. X        XDrawPoints(display, pixmap, contexts[col],
  567. X            points->data[col], points->npoints[col], CoordModeOrigin);
  568. X        points->npoints[col] = 0;
  569. X    }
  570. X    points->data[col][points->npoints[col]].x = x;
  571. X    points->data[col][points->npoints[col]].y = y;
  572. X    ++points->npoints[col];
  573. X}
  574. X
  575. Xvoid
  576. XBufferPoint(display, window, pixmap, contexts, points, col, x, y)
  577. XDisplay *display;
  578. XWindow window;
  579. XPixmap pixmap;
  580. XGC *contexts;
  581. Xpoints_t *points;
  582. Xint col, x, y;
  583. X{
  584. X    if (points->npoints[col] == MAXPOINTS)
  585. X    {
  586. X        XDrawPoints(display, window, contexts[col],
  587. X            points->data[col], points->npoints[col], CoordModeOrigin);
  588. X        XDrawPoints(display, pixmap, contexts[col],
  589. X            points->data[col], points->npoints[col], CoordModeOrigin);
  590. X        points->npoints[col] = 0;
  591. X    }
  592. X    points->data[col][points->npoints[col]].x = x;
  593. X    points->data[col][points->npoints[col]].y = y;
  594. X    ++points->npoints[col];
  595. X}
  596. X
  597. Xvoid
  598. XInitBuffer(points, maxcolor)
  599. Xpoints_t *points;
  600. Xint maxcolor;
  601. X{
  602. X    static int i;
  603. X
  604. X    for (i = 0 ; i < maxcolor; i++)
  605. X        points->npoints[i] = 0;
  606. X}
  607. X
  608. Xvoid
  609. XFlushPixmap(display, pixmap, contexts, points, mincolor, maxcolor)
  610. XDisplay *display;
  611. XPixmap pixmap;
  612. XGC *contexts;
  613. Xpoints_t *points;
  614. Xint mincolor, maxcolor;
  615. X{
  616. X    static int color;
  617. X
  618. X    for (color = mincolor; color < maxcolor; ++color)
  619. X        if (points->npoints[color]) {
  620. X            XDrawPoints(display, pixmap, contexts[color], points->data[color], 
  621. X                    points->npoints[color], CoordModeOrigin);
  622. X            points->npoints[color] = 0;
  623. X        }
  624. X}
  625. X
  626. Xvoid
  627. XFlushBuffer(display, window, pixmap, contexts, points, mincolor, maxcolor)
  628. XDisplay *display;
  629. XWindow window;
  630. XPixmap pixmap;
  631. XGC *contexts;
  632. Xpoints_t *points;
  633. Xint mincolor, maxcolor;
  634. X{
  635. X    static int color;
  636. X
  637. X    for (color = mincolor; color < maxcolor; ++color)
  638. X        if (points->npoints[color]) {
  639. X            XDrawPoints(display, window, contexts[color], points->data[color], 
  640. X                    points->npoints[color], CoordModeOrigin);
  641. X            XDrawPoints(display, pixmap, contexts[color], points->data[color], 
  642. X                    points->npoints[color], CoordModeOrigin);
  643. X            points->npoints[color] = 0;
  644. X        }
  645. X}
  646. END_OF_FILE
  647.   if test 3470 -ne `wc -c <'lyap/lib/buffer.c'`; then
  648.     echo shar: \"'lyap/lib/buffer.c'\" unpacked with wrong size!
  649.   fi
  650.   # end of 'lyap/lib/buffer.c'
  651. fi
  652. if test -f 'lyap/lib/init_color.c' -a "${1}" != "-c" ; then 
  653.   echo shar: Will not clobber existing file \"'lyap/lib/init_color.c'\"
  654. else
  655.   echo shar: Extracting \"'lyap/lib/init_color.c'\" \(13721 characters\)
  656.   sed "s/^X//" >'lyap/lib/init_color.c' <<'END_OF_FILE'
  657. X/*************************************************************************
  658. X *                                                                       *
  659. X *  Copyright (c) 1992, 1993 Ronald Joe Record                           *
  660. X *                                                                       *
  661. X *  All rights reserved. No part of this program or publication may be   *
  662. X *  reproduced, transmitted, transcribed, stored in a retrieval system,  *
  663. X *  or translated into any language or computer language, in any form or *
  664. X *  by any means, electronic, mechanical, magnetic, optical, chemical,   *
  665. X *  biological, or otherwise, without the prior written permission of:   *
  666. X *                                                                       *
  667. X *      Ronald Joe Record (408) 458-3718                                 *
  668. X *      212 Owen St., Santa Cruz, California 95062 USA                   *
  669. X *                                                                       *
  670. X *************************************************************************/
  671. X
  672. X#include <math.h>
  673. X#include <stdio.h>
  674. X#include <stdlib.h>
  675. X#include <string.h>
  676. X#include <X11/Xlib.h>
  677. X#include "libXrr.h"
  678. X
  679. Xint _numdivs = 2;
  680. X
  681. Xvoid
  682. Xinit_color(display, win, cmap, Colors, s_col, min, n_cols, wheel, prog, res, n)
  683. XDisplay *display;
  684. XWindow win;
  685. XColormap cmap;
  686. XXColor *Colors;
  687. Xint s_col, min, n_cols, wheel, n;
  688. Xchar *prog;
  689. Xchar *res;
  690. X{
  691. X    static short i, j, first_time=1;
  692. X    static int colgap, leg, step, numfree;
  693. X    static double d;
  694. X    Colormap def_cmap;
  695. X    int hls[3], rgb[3];
  696. X    static char *mapfile;
  697. X    FILE *map;
  698. X    char buf[255];
  699. X    int a, b, c, c_end;
  700. X    extern void hls2rgb();
  701. X    extern long lrand48();
  702. X
  703. X    def_cmap = DefaultColormap(display, DefaultScreen(display));
  704. X    for (i=0; i<s_col; i++)
  705. X        Colors[i].pixel = i;
  706. X    for (i=s_col; i<n_cols; i++) {
  707. X        Colors[i].pixel = i;
  708. X        Colors[i].flags = DoRed|DoGreen|DoBlue;
  709. X    }
  710. X    XQueryColors(display, def_cmap, Colors, n_cols);
  711. X    colgap = RGB_MAX / n_cols;
  712. X    hls[0] = 50;    /* Hue in low range */
  713. X    hls[2] = 1000;  /* Fully saturated */
  714. X    for (i=s_col; i<min; i++) {
  715. X        hls[1] = 1000L * (i-s_col) / (min - s_col);
  716. X        hls2rgb(hls, rgb);
  717. X        Colors[i].red = rgb[0];
  718. X        Colors[i].green = rgb[1];
  719. X        Colors[i].blue = rgb[2];
  720. X    }
  721. X    numfree = n_cols - min;
  722. X    if (wheel == -2) {    /* black & white palette */
  723. X        hls[1] = 1000;    /* Fully Light */
  724. X        hls[2] = 1000;    /* Fully saturated */
  725. X        for (i=s_col; i<((n_cols-s_col)/2)+s_col; i++) {
  726. X            hls[0] = 3000L;
  727. X            hls2rgb(hls, rgb);
  728. X            Colors[i].red = rgb[0];
  729. X            Colors[i].green = rgb[1];
  730. X            Colors[i].blue = rgb[2];
  731. X        }
  732. X        hls[1] = 0;    /* Fully Dark */
  733. X        hls[2] = 0;
  734. X        for (i=((n_cols-s_col)/2)+s_col; i<n_cols; i++) {
  735. X            hls[0] = 0;
  736. X            hls2rgb(hls, rgb);
  737. X            Colors[i].red = rgb[0];
  738. X            Colors[i].green = rgb[1];
  739. X            Colors[i].blue = rgb[2];
  740. X        }
  741. X    }
  742. X    if (wheel == -1) {    /* white palette */
  743. X        hls[1] = 1000;    /* Fully Light */
  744. X        hls[2] = 1000;    /* Fully saturated */
  745. X        for (i=s_col; i<n_cols; i++) {
  746. X            hls[0] = 3000L;
  747. X            hls2rgb(hls, rgb);
  748. X            Colors[i].red = rgb[0];
  749. X            Colors[i].green = rgb[1];
  750. X            Colors[i].blue = rgb[2];
  751. X        }
  752. X    }
  753. X    else if (wheel == 0) { /* read in cmap from $HOME/.<progname>map */
  754. X        if (first_time) {
  755. X            mapfile = XGetDefault(display, res, "Mapfile");
  756. X            if (!mapfile) {
  757. X                mapfile = strdup(getenv("HOME"));
  758. X                mapfile = strcat(mapfile, "/.");
  759. X                mapfile = strcat(mapfile, prog);
  760. X                mapfile = strdup(strcat(mapfile, "map"));
  761. X            }
  762. X            first_time = 0;
  763. X        }
  764. X        i = s_col;
  765. X        if ((map = fopen(mapfile, "r")) == NULL)
  766. X            perror(mapfile);
  767. X        else {
  768. X            while(!feof(map) && i <n_cols) {
  769. X                fgets(buf,sizeof buf,map);
  770. X                if(sscanf(buf,"%d %d %d",&a,&b,&c) == 3) {
  771. X                    Colors[i].red = a * 256;
  772. X                    Colors[i].green = b * 256;
  773. X                    Colors[i].blue = c * 256;
  774. X                    i++;
  775. X                }
  776. X            }
  777. X            c_end = i;
  778. X            while (i<n_cols) {
  779. X                Colors[i].red = Colors[i - c_end].red;
  780. X                Colors[i].green = Colors[i - c_end].green;
  781. X                Colors[i].blue = Colors[i - c_end].blue;
  782. X                i++;
  783. X            }
  784. X        }
  785. X        fclose(map);
  786. X    }
  787. X    if (wheel == 1) {
  788. X        colgap = 2*RGB_MAX/(n_cols - ((n_cols + min)/2));
  789. X        for (i=min; i<min+(numfree/2); i++) {
  790. X            Colors[i].blue = 0;
  791. X            Colors[i].green=((i+((n_cols + min)/2))*colgap);
  792. X            Colors[i].red=((i+((n_cols + min)/2))*colgap);
  793. X        }
  794. X        for (i=min+(numfree/2); i<n_cols; i++) {
  795. X            Colors[i].blue = 0;
  796. X            Colors[i].green=(((n_cols-i)+((n_cols + min)/2))*colgap);
  797. X            Colors[i].red=(((n_cols-i)+((n_cols + min)/2))*colgap);
  798. X        }
  799. X    }
  800. X    else if (wheel == 2) {
  801. X        hls[0] = 800;    /* Hue in mid range */
  802. X        hls[2] = 1000;    /* Fully saturated */
  803. X        for (i=s_col; i<min; i++) {
  804. X            hls[1]=1000L*(i-s_col) / (min - s_col);
  805. X            hls2rgb(hls, rgb);
  806. X            Colors[i].red = rgb[0];
  807. X            Colors[i].green = rgb[1];
  808. X            Colors[i].blue = rgb[2];
  809. X        }
  810. X        for (i=min; i<min+(numfree/2); i++) {
  811. X            Colors[i].blue = RGB_MAX;
  812. X            Colors[i].green = 0;
  813. X            Colors[i].red=(i*2*RGB_MAX/n_cols);
  814. X        }
  815. X        for (i=min+(numfree/2); i<n_cols; i++) {
  816. X            Colors[i].blue = RGB_MAX;
  817. X            Colors[i].green = 0;
  818. X            Colors[i].red=((n_cols - i)*2*RGB_MAX/n_cols);
  819. X        }
  820. X    }
  821. X    else if (wheel == 3) {
  822. X        hls[0] = 800;    /* Hue in mid range */
  823. X        hls[2] = 1000;    /* Fully saturated */
  824. X        for (i=s_col; i<min; i++) {
  825. X            hls[1]=1000L*(i-s_col) / (min - s_col);
  826. X            hls2rgb(hls, rgb);
  827. X            Colors[i].red = rgb[0];
  828. X            Colors[i].green = rgb[1];
  829. X            Colors[i].blue = rgb[2];
  830. X        }
  831. X        colgap = 4*RGB_MAX/n_cols;
  832. X        for (i=min; i<min+(numfree/4); i++) {
  833. X            Colors[i].blue = RGB_MAX;
  834. X            Colors[i].green = 0;
  835. X            Colors[i].red=(i*colgap);
  836. X        }
  837. X        for (i=min+(numfree/4);i<min+(numfree/2);i++) {
  838. X            Colors[i].red = RGB_MAX;
  839. X            Colors[i].green = 0;
  840. X            Colors[i].blue=(min+(numfree/2) - i) * colgap;
  841. X        }
  842. X        for(i=min+(numfree/2);i<min+(0.75*numfree);i++){
  843. X            Colors[i].red = RGB_MAX;
  844. X            Colors[i].blue=(i * colgap);
  845. X            Colors[i].green = 0;
  846. X        }
  847. X        for (i=min+(0.75*numfree); i<n_cols; i++) {
  848. X            Colors[i].blue = RGB_MAX;
  849. X            Colors[i].green = 0;
  850. X            Colors[i].red=(n_cols-i)*colgap;
  851. X        }
  852. X    }
  853. X    else if (wheel == 4) {
  854. X        hls[0] = 800;    /* Hue in mid range */
  855. X        hls[2] = 1000;    /* Fully saturated */
  856. X        for (i=s_col; i<min; i++) {
  857. X            hls[1] = 1000L * (i-s_col) / (min - s_col);
  858. X            hls2rgb(hls, rgb);
  859. X            Colors[i].red = rgb[0];
  860. X            Colors[i].green = rgb[1];
  861. X            Colors[i].blue = rgb[2];
  862. X        }
  863. X        colgap = wheel * RGB_MAX / n_cols;
  864. X        for (i=min; i<(n_cols/wheel); i++) {
  865. X            Colors[i].blue = RGB_MAX;
  866. X            Colors[i].green = 0;
  867. X            Colors[i].red=(i*colgap);
  868. X        }
  869. X        for (i=(n_cols/wheel); i<(2*n_cols/wheel); i++) {
  870. X            Colors[i].red = RGB_MAX;
  871. X            Colors[i].green = 0;
  872. X            Colors[i].blue=((2*n_cols/wheel) - i) * colgap;
  873. X        }
  874. X        for (i=(2*n_cols/wheel); i<n_cols; i++) {
  875. X            Colors[i].red = RGB_MAX;
  876. X            Colors[i].green=(i - (2*n_cols/wheel)) * colgap;
  877. X            Colors[i].blue = 0;
  878. X        }
  879. X    }
  880. X    else if (wheel == 5) {
  881. X        hls[1] = 700;    /* Lightness in midrange */
  882. X        hls[2] = 1000;    /* Fully saturated */
  883. X        for (i=min; i<n_cols; i++) {
  884. X            hls[0] = 3600L * i / n_cols;
  885. X            hls2rgb(hls, rgb);
  886. X            Colors[i].red = rgb[0];
  887. X            Colors[i].green = rgb[1];
  888. X            Colors[i].blue = rgb[2];
  889. X        }
  890. X        for (i=min; i<n_cols; i+=((n_cols-min)/10)) {
  891. X            hls[0] = 3600L * i / n_cols;
  892. X            hls2rgb(hls, rgb);
  893. X            Colors[i].red = rgb[0] / 2;
  894. X            Colors[i].green = rgb[1] / 2;
  895. X            Colors[i].blue = rgb[2] / 2;
  896. X        }
  897. X    }
  898. X    else if (wheel == 6) {
  899. X        hls[0] = 800;    /* Hue in mid range */
  900. X        hls[2] = 1000;    /* Fully saturated */
  901. X        for (i=s_col; i<min; i++) {
  902. X            hls[1] = 1000L * (i-s_col) / (min - s_col);
  903. X            hls2rgb(hls, rgb);
  904. X            Colors[i].red = rgb[0];
  905. X            Colors[i].green = rgb[1];
  906. X            Colors[i].blue = rgb[2];
  907. X        }
  908. X        step = numfree / 3;
  909. X        leg = step+min;
  910. X        for (i = min; i < leg; ++i) {
  911. X            Colors[i].pixel = i;
  912. X            Colors[i].red = fabs(65535 - (double)i / step * 65535.0);
  913. X            Colors[i].blue = (double)i / step * 65535.0;
  914. X            Colors[i].green = 0;
  915. X            Colors[i].flags = DoRed | DoGreen | DoBlue;
  916. X        }
  917. X        for (j = 0, i = leg, leg += step; i < leg; ++i, ++j) {
  918. X            Colors[i].pixel = i;
  919. X            Colors[i].red = (double)j / step * 65535.0;
  920. X            Colors[i].blue = 65535;
  921. X            Colors[i].green = Colors[i].red;
  922. X            Colors[i].flags = DoRed | DoGreen | DoBlue;
  923. X        }
  924. X        for (j = 0, i = leg, leg += step; i < leg; ++i, ++j) {
  925. X            Colors[i].pixel = i;
  926. X            Colors[i].red = 65535;
  927. X            Colors[i].blue = fabs(65535 - (double)j / step * 65535.0);
  928. X            Colors[i].green = Colors[i].blue;
  929. X            Colors[i].flags = DoRed | DoGreen | DoBlue;
  930. X        }
  931. X    }
  932. X    else if (wheel == 7) {    /* random palette */
  933. X        hls[1] = 500;    /* Lightness in midrange */
  934. X        hls[2] = 1000;    /* Fully saturated */
  935. X        for (i=min; i<n_cols; i++) {
  936. X            hls[0] = 3600L * (lrand48() % n_cols) / n_cols;
  937. X            hls2rgb(hls, rgb);
  938. X            Colors[i].red = rgb[0];
  939. X            Colors[i].green = rgb[1];
  940. X            Colors[i].blue = rgb[2];
  941. X        }
  942. X    }
  943. X    /* wheel=8 indicates the default color map which is already queried */
  944. X    else if (wheel == 9) {    /* red, green, blue for 3 basins */
  945. X        hls[0] = 60;   /* hue at low end */
  946. X        hls[2] = 1000;    /* Fully saturated */
  947. X        for (i=s_col; i<((n_cols-s_col)/3)+s_col; i++) {
  948. X            hls[1] = 800L * i / (((n_cols-s_col)/3)+s_col);
  949. X            hls2rgb(hls, rgb);
  950. X            Colors[i].red = rgb[0];
  951. X            Colors[i].green = rgb[1];
  952. X            Colors[i].blue = rgb[2];
  953. X        }
  954. X        hls[0] = 800;   /* hue in middle */
  955. X        for (i=((n_cols-s_col)/3)+s_col;i<(2*(n_cols-s_col)/3)+s_col;i++) {
  956. X            hls[1] = 800L * i / ((2*(n_cols-s_col)/3)+s_col);
  957. X            hls2rgb(hls, rgb);
  958. X            Colors[i].red = rgb[0];
  959. X            Colors[i].green = rgb[1];
  960. X            Colors[i].blue = rgb[2];
  961. X        }
  962. X        hls[0] = 1600;   /* hue in upper range */
  963. X        for (i=(2*(n_cols-s_col)/3)+s_col; i<n_cols; i++) {
  964. X            hls[1] = 800L * i / n_cols;
  965. X            hls2rgb(hls, rgb);
  966. X            Colors[i].red = rgb[0];
  967. X            Colors[i].green = rgb[1];
  968. X            Colors[i].blue = rgb[2];
  969. X        }
  970. X    }
  971. X    else if (wheel == 10) {    /* palette of several rainbows */
  972. X        hls[1] = 500;    /* Lightness in midrange */
  973. X        hls[2] = 1000;    /* Fully saturated */
  974. X        for (i=s_col; i<n_cols; i++) {
  975. X            hls[0] = 3000L*((i-s_col)%((n_cols-s_col)/_numdivs)) 
  976. X                    / ((n_cols-s_col)/_numdivs);
  977. X            hls2rgb(hls, rgb);
  978. X            Colors[i].red = rgb[0];
  979. X            Colors[i].green = rgb[1];
  980. X            Colors[i].blue = rgb[2];
  981. X        }
  982. X    }
  983. X    else if (wheel == 11) {    /* reverse rainbow palette */
  984. X        hls[1] = 500;    /* Lightness in midrange */
  985. X        hls[2] = 1000;    /* Fully saturated */
  986. X        for (i=s_col; i<n_cols; i++) {
  987. X            hls[0] = 3000L * (i - s_col) / (n_cols - s_col);
  988. X            hls2rgb(hls, rgb);
  989. X            Colors[i].red = rgb[0];
  990. X            Colors[i].green = rgb[1];
  991. X            Colors[i].blue = rgb[2];
  992. X        }
  993. X    }
  994. X    else if (wheel == 12) {    /* green colormap */
  995. X        hls[0] = 1200;    /* Green Hue */
  996. X        hls[2] = 1000;    /* Fully saturated */
  997. X        for (i=s_col; i<n_cols; i++) {
  998. X            hls[1] = (800L * (n_cols - i) / (n_cols - s_col)) + 100L;
  999. X            hls2rgb(hls, rgb);
  1000. X            Colors[i].red = rgb[0];
  1001. X            Colors[i].green = rgb[1];
  1002. X            Colors[i].blue = rgb[2];
  1003. X        }
  1004. X    }
  1005. X    else if (wheel == 13) {    /* green "tent" shaped colormap */
  1006. X        colgap = 2*RGB_MAX/(n_cols - ((n_cols + min)/2));
  1007. X        for (i=s_col; i<s_col+((n_cols - s_col)/2); i++) {
  1008. X            Colors[i].blue = 0;
  1009. X            Colors[i].green=((i+((n_cols + min)/2))*colgap);
  1010. X            Colors[i].red=((i+((n_cols + min)/2))*colgap);
  1011. X        }
  1012. X        for (i=s_col+((n_cols - s_col)/2); i<n_cols; i++) {
  1013. X            Colors[i].blue = 0;
  1014. X            Colors[i].green=(((n_cols-i)+((n_cols + min)/2))*colgap);
  1015. X            Colors[i].red=(((n_cols-i)+((n_cols + min)/2))*colgap);
  1016. X        }
  1017. X    }
  1018. X    else if (wheel == 14) {    /* red, green, blue for n basins */
  1019. X        hls[2] = 1000L;
  1020. X        if (n) {
  1021. X            d = (double)(n_cols - s_col)/(double)n;
  1022. X            for (j=0; j<n; j++) {
  1023. X                hls[0] = (j*2500L/n)+250L; /* hue */
  1024. X                for (i=s_col+(j*d); i<((j+1)*d)+s_col; i++) {
  1025. X                    if (i >= n_cols)
  1026. X                        break;
  1027. X                    hls[1] = 250L + (500L * (double)(i-s_col-(j*d)) / d);
  1028. X                    hls2rgb(hls, rgb);
  1029. X                    Colors[i].red = rgb[0];
  1030. X                    Colors[i].green = rgb[1];
  1031. X                    Colors[i].blue = rgb[2];
  1032. X                }
  1033. X            }
  1034. X        }
  1035. X        else {
  1036. X            hls[0] = 0L; /* hue */
  1037. X            for (i=s_col; i<n_cols; i++) {
  1038. X                hls[1] = 100L + (800L * (double)(i-s_col) / (n_cols - s_col));
  1039. X                hls2rgb(hls, rgb);
  1040. X                Colors[i].red = rgb[0];
  1041. X                Colors[i].green = rgb[1];
  1042. X                Colors[i].blue = rgb[2];
  1043. X            }
  1044. X        }
  1045. X    }
  1046. X    else if (wheel == 15) {    /* rainbow palette */
  1047. X        hls[1] = 500;    /* Lightness in midrange */
  1048. X        hls[2] = 1000;    /* Fully saturated */
  1049. X        for (i=s_col; i<n_cols; i++) {
  1050. X            hls[0] = 3000L * (i - s_col) / (n_cols - s_col);
  1051. X            hls2rgb(hls, rgb);
  1052. X            Colors[i].red = rgb[0];
  1053. X            Colors[i].green = rgb[1];
  1054. X            Colors[i].blue = rgb[2];
  1055. X        }
  1056. X    }
  1057. X    XStoreColors(display, cmap, Colors, n_cols);
  1058. X    /* install new color map */
  1059. X    XSetWindowColormap(display, win, cmap);
  1060. X}
  1061. END_OF_FILE
  1062.   if test 13721 -ne `wc -c <'lyap/lib/init_color.c'`; then
  1063.     echo shar: \"'lyap/lib/init_color.c'\" unpacked with wrong size!
  1064.   fi
  1065.   # end of 'lyap/lib/init_color.c'
  1066. fi
  1067. if test -f 'lyap/lib/spin.c' -a "${1}" != "-c" ; then 
  1068.   echo shar: Will not clobber existing file \"'lyap/lib/spin.c'\"
  1069. else
  1070.   echo shar: Extracting \"'lyap/lib/spin.c'\" \(3849 characters\)
  1071.   sed "s/^X//" >'lyap/lib/spin.c' <<'END_OF_FILE'
  1072. X/*************************************************************************
  1073. X *                                                                       *
  1074. X *  Copyright (c) 1992, 1993 Ronald Joe Record                           *
  1075. X *                                                                       *
  1076. X *  All rights reserved. No part of this program or publication may be   *
  1077. X *  reproduced, transmitted, transcribed, stored in a retrieval system,  *
  1078. X *  or translated into any language or computer language, in any form or *
  1079. X *  by any means, electronic, mechanical, magnetic, optical, chemical,   *
  1080. X *  biological, or otherwise, without the prior written permission of:   *
  1081. X *                                                                       *
  1082. X *      Ronald Joe Record (408) 458-3718                                 *
  1083. X *      212 Owen St., Santa Cruz, California 95062 USA                   *
  1084. X *                                                                       *
  1085. X *************************************************************************/
  1086. X
  1087. X#include <X11/Xlib.h>
  1088. X
  1089. X#ifdef USE_DELAY
  1090. X
  1091. X#include <signal.h>
  1092. X#include <sys/time.h>
  1093. X
  1094. Xstatic int timerdone;
  1095. X
  1096. Xstatic void onalarm() {
  1097. X    timerdone = 1;
  1098. X}
  1099. X
  1100. X/*******/
  1101. Xvoid Timer(n)   /* waits for 'n' milliseconds (from xv-2.21 source) */
  1102. X int  n;
  1103. X/*******/
  1104. X{
  1105. X  long usec;
  1106. X#ifdef HAS_ITIMER
  1107. X  struct itimerval it;
  1108. X#endif
  1109. X
  1110. X  if (!n) return;
  1111. X
  1112. X  usec = (long) n * 1000;
  1113. X  
  1114. X#ifdef HAS_ITIMER
  1115. X  memset(&it, 0, sizeof(it));
  1116. X  if (usec>=1000000L) {  /* more than 1 second */
  1117. X    it.it_value.tv_sec = usec / 1000000L;
  1118. X    usec %= 1000000L;
  1119. X  }
  1120. X
  1121. X  it.it_value.tv_usec = usec;
  1122. X#endif
  1123. X  timerdone=0;
  1124. X  signal(SIGALRM,onalarm);
  1125. X#ifdef HAS_ITIMER
  1126. X  setitimer(ITIMER_REAL, &it, (struct itimerval *)0);
  1127. X  while (1) {
  1128. X/*    sigblock(sigmask(SIGALRM));  note:  have to block, so that ALRM */
  1129. X    if (timerdone) break;        /* doesn't occur between 'if (timerdone)' */
  1130. X    else sigpause(0);            /* and calling sigpause(0) */
  1131. X  }
  1132. X
  1133. X/*  sigblock(0);                    turn ALRM blocking off */
  1134. X  signal(SIGALRM,SIG_DFL);
  1135. X#else
  1136. X  nap((long)n);
  1137. X#endif
  1138. X}
  1139. X
  1140. X#endif /*USE_DELAY */
  1141. X
  1142. Xvoid
  1143. XSpin(display, colormap, colors, start_color, num_colors, delay, dir)
  1144. XDisplay *display;
  1145. XColormap colormap;
  1146. XXColor *colors;
  1147. Xint start_color, num_colors;
  1148. Xshort dir, delay;
  1149. X{
  1150. X    static short i;
  1151. X    static long tmpxcolor;
  1152. X
  1153. X    while (!XPending(display)) {
  1154. X        if (dir) {
  1155. X            tmpxcolor = colors[start_color].pixel;
  1156. X            for (i=start_color;i<num_colors-1;i++)
  1157. X                colors[i].pixel = colors[i+1].pixel;
  1158. X            colors[num_colors-1].pixel = tmpxcolor;
  1159. X        }
  1160. X        else {
  1161. X            tmpxcolor = colors[num_colors-1].pixel;
  1162. X            for (i=num_colors-1;i>start_color;i--)
  1163. X                colors[i].pixel = colors[i-1].pixel;
  1164. X            colors[start_color].pixel = tmpxcolor;
  1165. X        }
  1166. X        XStoreColors(display, colormap, colors, num_colors);
  1167. X#ifdef USE_DELAY
  1168. X    Timer(delay);
  1169. X#endif
  1170. X    }
  1171. X}
  1172. X
  1173. Xvoid
  1174. XDemoSpin(display, colormap, colors, start_color, num_colors, delay, factor)
  1175. XDisplay *display;
  1176. XColormap colormap;
  1177. XXColor *colors;
  1178. Xint start_color, num_colors;
  1179. Xshort delay, factor;
  1180. X{
  1181. X    static short i, j;
  1182. X    long tmpxcolor;
  1183. X
  1184. X    for (j=0;j<factor*num_colors;j++) {
  1185. X        tmpxcolor = colors[start_color].pixel;
  1186. X        for (i=start_color;i<num_colors-1;i++)
  1187. X            colors[i].pixel = colors[i+1].pixel;
  1188. X        colors[num_colors-1].pixel = tmpxcolor;
  1189. X        XStoreColors(display, colormap, colors, num_colors);
  1190. X#ifdef USE_DELAY
  1191. X    Timer(delay);
  1192. X#endif
  1193. X    }
  1194. X    for (j=0;j<factor*num_colors;j++) {
  1195. X        tmpxcolor = colors[num_colors-1].pixel;
  1196. X        for (i=num_colors-1;i>start_color;i--)
  1197. X            colors[i].pixel = colors[i-1].pixel;
  1198. X        colors[start_color].pixel = tmpxcolor;
  1199. X        XStoreColors(display, colormap, colors, num_colors);
  1200. X#ifdef USE_DELAY
  1201. X    Timer(delay);
  1202. X#endif
  1203. X    }
  1204. X}
  1205. END_OF_FILE
  1206.   if test 3849 -ne `wc -c <'lyap/lib/spin.c'`; then
  1207.     echo shar: \"'lyap/lib/spin.c'\" unpacked with wrong size!
  1208.   fi
  1209.   # end of 'lyap/lib/spin.c'
  1210. fi
  1211. if test -f 'lyap/lyap.h' -a "${1}" != "-c" ; then 
  1212.   echo shar: Will not clobber existing file \"'lyap/lyap.h'\"
  1213. else
  1214.   echo shar: Extracting \"'lyap/lyap.h'\" \(5377 characters\)
  1215.   sed "s/^X//" >'lyap/lyap.h' <<'END_OF_FILE'
  1216. X/*
  1217. X *    @(#) lyap.h 9.4 93/08/18
  1218. X */
  1219. X/*************************************************************************
  1220. X *                                                                       *
  1221. X *  Copyright (c) 1992, 1993 Ronald Joe Record                           *
  1222. X *                                                                       *
  1223. X *  All rights reserved. No part of this program or publication may be   *
  1224. X *  reproduced, transmitted, transcribed, stored in a retrieval system,  *
  1225. X *  or translated into any language or computer language, in any form or *
  1226. X *  by any means, electronic, mechanical, magnetic, optical, chemical,   *
  1227. X *  biological, or otherwise, without the prior written permission of:   *
  1228. X *                                                                       *
  1229. X *      Ronald Joe Record (408) 458-3718                                 *
  1230. X *      212 Owen St., Santa Cruz, California 95062 USA                   *
  1231. X *                                                                       *
  1232. X *************************************************************************/
  1233. X
  1234. X/*
  1235. X *    Written by Ron Record (rr@sco.com) 03 Sep 1991.
  1236. X */
  1237. X
  1238. Xstatic char *lyap_h_id = "@(#) lyap.h 9.4 93/08/18";
  1239. X
  1240. X#include "patchlevel.h"
  1241. X#include "libXrr.h"
  1242. X#include <assert.h>
  1243. X#include <math.h>
  1244. X#include <memory.h>
  1245. X#include <stdio.h>
  1246. X#include <stdlib.h>
  1247. X#include <string.h>
  1248. X#include <values.h>
  1249. X#include <X11/Xlib.h> 
  1250. X#include <X11/StringDefs.h> 
  1251. X#include <X11/keysym.h> 
  1252. X#include <X11/cursorfont.h> 
  1253. X#include <X11/Xutil.h>
  1254. X#include <X11/Xatom.h>
  1255. X
  1256. X#define ABS(a)    (((a)<0) ? (0-(a)) : (a) )
  1257. X#define Min(x,y) ((x < y)?x:y)
  1258. X#define Max(x,y) ((x > y)?x:y)
  1259. X
  1260. X/* Useful mathematical constants that should have been defined in math.h 
  1261. X * M_LOG2E    - log2(e)
  1262. X * M_LN2        - ln(2)
  1263. X * M_PI        - pi
  1264. X */
  1265. X#ifndef M_LOG2E
  1266. X#define M_LOG2E    1.4426950408889634074
  1267. X#endif
  1268. X#ifndef M_PI
  1269. X#define M_PI    3.14159265358979323846
  1270. X#endif
  1271. X#ifndef M_LN2
  1272. X#define M_LN2      6.9314718055994530942E-1 /*Hex  2^-1 * 1.62E42FEFA39EF */
  1273. X#endif
  1274. X
  1275. X/* Useful machine-dependent values that should have been defined in values.h
  1276. X * LN_MAXDOUBLE - the natural log of the largest double  -- log(MAXDOUBLE)
  1277. X * LN_MINDOUBLE - the natural log of the smallest double -- log(MINDOUBLE)
  1278. X */
  1279. X#ifndef LN_MINDOUBLE
  1280. X#define LN_MINDOUBLE (M_LN2 * (DMINEXP - 1))
  1281. X#endif
  1282. X#ifndef LN_MAXDOUBLE
  1283. X#define LN_MAXDOUBLE (M_LN2 * DMAXEXP)
  1284. X#endif
  1285. X
  1286. X#ifndef TRUE
  1287. X#define TRUE 1
  1288. X#define FALSE 0
  1289. X#endif
  1290. X
  1291. X#define MAXFRAMES 2
  1292. X
  1293. Xint maxcolor=256, startcolor=17, color_offset=96, mincolindex=33;
  1294. Xint dwell=100, settle=50;
  1295. Xint width=256, height=256, xposition=-1, yposition=-1;
  1296. Xshort delay=0;
  1297. Xint bottom, screen;
  1298. XDisplay*    dpy;
  1299. Xchar*        displayname = 0;
  1300. XFILE *infile;
  1301. X
  1302. Xextern double log();
  1303. Xextern double fabs();
  1304. Xextern long time();
  1305. Xextern int optind;
  1306. Xextern char *optarg;
  1307. X
  1308. Xunsigned long foreground, background;
  1309. X
  1310. XWindow canvas;
  1311. X
  1312. Xvoid     resize();
  1313. Xvoid     redisplay();
  1314. Xvoid     quit();
  1315. Xvoid     Spin();
  1316. Xvoid     start_iterate();
  1317. Xvoid     stop_iterate();
  1318. Xvoid     show_defaults();
  1319. Xvoid     StartRubberBand();
  1320. Xvoid     TrackRubberBand();
  1321. Xvoid     EndRubberBand();
  1322. Xvoid     CreateXorGC();
  1323. Xvoid     InitBuffer();
  1324. Xvoid     BufferPoint();
  1325. Xvoid     FlushBuffer();
  1326. X
  1327. Xtypedef struct {
  1328. X    int x, y;
  1329. X} xy_t;
  1330. X
  1331. Xtypedef struct {
  1332. X    int start_x, start_y;
  1333. X    int last_x, last_y;
  1334. X    } rubber_band_data_t;
  1335. X
  1336. Xtypedef struct {
  1337. X    Cursor band_cursor;
  1338. X    double p_min, p_max, q_min, q_max;
  1339. X    rubber_band_data_t rubber_band;
  1340. X    } image_data_t;
  1341. X
  1342. Xpoints_t Points; /* typedef in ../lib/libXrr.h */
  1343. Ximage_data_t rubber_data;
  1344. X
  1345. XGC Data_GC[MAXCOLOR], RubberGC;
  1346. X
  1347. X#define MAXINDEX 64
  1348. X#define FUNCMAXINDEX 16
  1349. X#define NUMMAPS 5
  1350. X
  1351. Xtypedef double (*PFD)();
  1352. X
  1353. Xdouble logistic(), circle(), leftlog(), rightlog(), doublelog();
  1354. Xdouble dlogistic(), dcircle(), dleftlog(), drightlog(), ddoublelog();
  1355. XPFD map, deriv;
  1356. XPFD Maps[NUMMAPS] = { logistic, circle, leftlog, rightlog, doublelog };
  1357. XPFD Derivs[NUMMAPS] = { dlogistic, dcircle, dleftlog, drightlog, ddoublelog };
  1358. X
  1359. Xint aflag=0, bflag=0, wflag=0, hflag=0, Rflag=0;
  1360. Xdouble pmins[NUMMAPS] = { 2.0, 0.0, 0.0, 0.0, 0.0 };
  1361. Xdouble pmaxs[NUMMAPS] = { 4.0, 1.0, 6.75, 6.75, 16.0 };
  1362. Xdouble amins[NUMMAPS] = { 2.0, 0.0, 0.0, 0.0, 0.0 };
  1363. Xdouble aranges[NUMMAPS] = { 2.0, 1.0, 6.75, 6.75, 16.0 };
  1364. Xdouble bmins[NUMMAPS] = { 2.0, 0.0, 0.0, 0.0, 0.0 };
  1365. Xdouble branges[NUMMAPS] = { 2.0, 1.0, 6.75, 6.75, 16.0 };
  1366. X
  1367. Xint   forcing[MAXINDEX] = { 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,
  1368. X            0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,
  1369. X            0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1 };
  1370. Xint   Forcing[FUNCMAXINDEX] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
  1371. X
  1372. Xint   maxindex = MAXINDEX;
  1373. Xint   funcmaxindex = FUNCMAXINDEX;
  1374. Xdouble    min_a=2.0, min_b=2.0, a_range=2.0, b_range=2.0, minlyap=1.0;
  1375. Xdouble  max_a=4.0, max_b=4.0;
  1376. Xdouble  start_x=0.5, lyapunov, a_inc, b_inc, a, b;
  1377. Xint    numcolors=16, numfreecols, displayplanes, lowrange;
  1378. Xxy_t    point, velocity;
  1379. XPixmap  pixmap;
  1380. XColormap cmap;
  1381. XXColor    Colors[MAXCOLOR];
  1382. Xdouble  *exponents[MAXFRAMES];
  1383. Xdouble  a_minimums[MAXFRAMES], b_minimums[MAXFRAMES];
  1384. Xdouble  a_maximums[MAXFRAMES], b_maximums[MAXFRAMES];
  1385. Xdouble  minexp, maxexp, prob=0.5;
  1386. Xint     expind[MAXFRAMES]={0}, resized[MAXFRAMES]={0};
  1387. Xint    numwheels=MAXWHEELS, force=0, Force=0, negative=1;
  1388. Xint     nostart=1, stripe_interval=7;
  1389. Xint    save=1, show=0, useprod=1, savefile=0, restfile=0, storefile=0;
  1390. Xint    maxframe=0, frame=0, dorecalc=0, mapindex=0, run=1, demo=0;
  1391. Xchar    *outname="lyap.ppm";
  1392. Xchar    *inname="lyap.sav";
  1393. Xchar    *savname="lyap.sav";
  1394. END_OF_FILE
  1395.   if test 5377 -ne `wc -c <'lyap/lyap.h'`; then
  1396.     echo shar: \"'lyap/lyap.h'\" unpacked with wrong size!
  1397.   fi
  1398.   # end of 'lyap/lyap.h'
  1399. fi
  1400. if test -f 'lyap/lyap.man' -a "${1}" != "-c" ; then 
  1401.   echo shar: Will not clobber existing file \"'lyap/lyap.man'\"
  1402. else
  1403.   echo shar: Extracting \"'lyap/lyap.man'\" \(7420 characters\)
  1404.   sed "s/^X//" >'lyap/lyap.man' <<'END_OF_FILE'
  1405. X.\"    @(#) lyap.man 9.2 93/08/23 SCOINC
  1406. X.\"
  1407. X.TH LYAP LOCAL
  1408. X.SH NAME
  1409. Xlyap \- display an array of Lyapunov exponents graphically
  1410. X.SH SYNOPSIS
  1411. X.in +8n
  1412. X.ti -8n
  1413. X\fIlyap\fR
  1414. X[-BLps][-W width][-H height][-o filename][-a 
  1415. X\fIn\fR ]
  1416. X[-b 
  1417. X\fIn\fR ]
  1418. X[-w 
  1419. X\fIn\fR ]
  1420. X[-h 
  1421. X\fIn\fR ]
  1422. X[-i xstart]
  1423. X[-M 
  1424. X\fIn\fR ]
  1425. X[-R 
  1426. X\fIp\fR ]
  1427. X[-S 
  1428. X\fIn\fR ]
  1429. X[-D 
  1430. X\fIn\fR ]
  1431. X[-F string][-f string][-r 
  1432. X\fIn\fR ]
  1433. X[-O 
  1434. X\fIn\fR ]
  1435. X[-C 
  1436. X\fIn\fR ]
  1437. X[-c 
  1438. X\fIn\fR ]
  1439. X[-m 
  1440. X\fIn\fR ]
  1441. X[-x xpos]
  1442. X[-y ypos]
  1443. X.in -8n
  1444. X.SH DESCRIPTION
  1445. X\fIlyap\fR
  1446. Xgenerates and graphically displays an array of Lyapunov exponents for a 
  1447. Xvariety of iterated periodically forced non-linear maps of the unit interval.
  1448. X.SH OPTIONS
  1449. X.TP 8
  1450. X-C \fIn\fP
  1451. XSpecifies the minimum color index to be used for negative exponents
  1452. X.TP
  1453. X-D \fIn\fP
  1454. XSpecifies the "dwell" or number of iterations over which to average in order
  1455. Xto calculate the Lyapunov exponent. Default is 400.
  1456. X.TP
  1457. X-H \fIn\fP
  1458. XSpecifies the height of the window. Default is 256.
  1459. X.TP
  1460. X-L 
  1461. XIndicates use log(x) + log(y) rather than log(xy).
  1462. X.TP
  1463. X-M \fIr\fP
  1464. XSpecifies the real value to compare exponent values to for indexing into
  1465. Xa color wheel. The default value is 1.0.
  1466. X.TP
  1467. X-O \fIn\fP
  1468. XSpecifies the minimum color index to be used for positive exponents
  1469. X.TP
  1470. X-R \fIp\fP
  1471. XSpecifies pseudo-random forcing with probability \fIp\fP of using parameter
  1472. Xvalue 'a'.
  1473. X.TP
  1474. X-S \fIn\fP
  1475. XSpecifies the "settle" or number of iterations prior to the beginning of
  1476. Xthe calculation of the Lyapunov exponent. Default is 200.
  1477. X.TP
  1478. X-W \fIn\fP
  1479. XSpecifies the width of the window. Default is 256.
  1480. X.TP
  1481. X-a \fIr\fP
  1482. XSpecifies the real value to use as the minimum parameter value of the 
  1483. Xhorizontal axis. Default is 3.0 for the logistic map.
  1484. X.TP
  1485. X-b \fIn\fP
  1486. XSpecifies the real value to use as the minimum parameter value of the 
  1487. Xvertical axis. Default is 3.0 for the logistic map.
  1488. X.TP
  1489. X-c \fIn\fP
  1490. XSelects one of six different color wheels to use. The default color
  1491. Xwheel is a rainbow palette.
  1492. X.TP
  1493. X-F \fI10101010\fP
  1494. XSpecifies the "Function" forcing function to use. The example above would 
  1495. Xalternate between iterating the circle and logistic maps. An argument of
  1496. X"-F 2323" would alternate between left and right logistic maps. The default
  1497. Xis to only use the single specified map (see the description of -m).
  1498. X.TP
  1499. X-f \fIabbabaab\fP
  1500. XSpecifies the forcing function to use. The default is to alternate between
  1501. Xthe "a" parameter and the "b" parameter.
  1502. X.TP
  1503. X-h \fIr\fP
  1504. XSpecifies the real value to be used as the range over which the vertical
  1505. Xparameter values vary. The default is 1.0.
  1506. X.TP
  1507. X-i \fIr\fP
  1508. XSpecifies the real value of the initial condition to use. Default is 0.05.
  1509. X.TP
  1510. X-m \fIn\fP
  1511. XSelects between available non-linear maps of the unit interval. A value of
  1512. X0 specifies the logistic map. A value of 1, the circle map. A value of 2,
  1513. Xthe left-logistic. A value of 3, the right-logistic. A value of 4, the
  1514. Xdouble-logistic. The default is 0, the logistic map.
  1515. X.TP
  1516. X-o \fIfilename\fP
  1517. XSpecifies the output filename to be used. If the -o option is given, this
  1518. Xfile will automatically be written out at the completion of the drawing.
  1519. XIf it is not specified, a default filename of lyap.out is used and only
  1520. Xwritten if the 'F' key is pressed during a run. The format of the
  1521. Xoutput file is PPM for color and PGM for monochrome. The parameters used to
  1522. Xcalculate the picture are included as comments at the beginning of the file.
  1523. X.TP
  1524. X-p
  1525. XSwitches color indices for negative and positive exponents. Generally,
  1526. Xcauses negative exponents to be displayed in more detail while darkening
  1527. Xand narrowing the color range for positive exponents. This can be toggled
  1528. Xduring runtime by pressing the 'p' key.
  1529. X.TP
  1530. X-r \fIn\fP
  1531. XSpecifies the maximum rgb value to be used. Default is 35000.
  1532. X.TP
  1533. X-s \fIfilename\fP
  1534. XSpecifies the output filename to be used when saving for a later restart. 
  1535. XIf the -s option is given, this file will automatically be written out at 
  1536. Xthe completion of the drawing. If it is not specified, a default filename 
  1537. Xof lyap.sav is used and only written if the 'f' key is pressed during a run. 
  1538. XThe color indices are saved for picture restoration. The parameters and
  1539. Xother variables necessary to resume calculation are stored as well. You
  1540. Xcan therefore use the -s option or 'f' key to temporarily save the program's 
  1541. Xstate and resume at a later time.
  1542. X.TP
  1543. X-u
  1544. XProduces a usage message.
  1545. X.TP
  1546. X-v 
  1547. XPrints out the various values to be used and exits.
  1548. X.TP
  1549. X-w \fIr\fP
  1550. XSpecifies the real value to be used as the range over which the horizontal
  1551. Xparameter values vary. The default is 1.0.
  1552. X.TP
  1553. X-x \fIn\fP
  1554. XSpecifies the x screen coordinate of the window (default is 256).
  1555. X.TP
  1556. X-y \fIn\fP
  1557. XSpecifies the y screen coordinate of the window (default is 256).
  1558. X.sp 2
  1559. X.SH NOTES
  1560. X.sp
  1561. XDuring display, pressing any mouse button allows you to select the area to
  1562. Xbe investigated with the mouse. The upper left hand corner of the desired
  1563. Xarea is the location of the cursor when the button is pressed. The lower
  1564. Xright hand corner is specified by the cursor when the button is released.
  1565. X.sp 2
  1566. XUse of the keys 
  1567. X\fIdDeEfFkKjJmnrRsSuUwWxXqQ\fP
  1568. Xindicates:
  1569. X.sp
  1570. X.ti 10
  1571. X(<) Halve dwell value.
  1572. X.ti 10
  1573. X(>) Double dwell value.
  1574. X.ti 10
  1575. X([) Halve settle value.
  1576. X.ti 10
  1577. X(]) Double settle value.
  1578. X.ti 10
  1579. X(d) Descends the ladder of lyap windows if a ladder has previously been
  1580. Xascended via the 'u' or 'U' keys.
  1581. X.ti 10
  1582. X(D) Flushes the drawing buffer
  1583. X.ti 10
  1584. X(E or e) Recalculate the indices into the color wheel using a different method
  1585. X.ti 10
  1586. X(f) Save current screen to lyap format ouput file for later continuation
  1587. X.ti 10
  1588. X(F) Save current screen to PPM format ouput file for later redisplay
  1589. X.ti 10
  1590. X(H or h or ?) Display brief help message
  1591. X.ti 10
  1592. X(i) Decrement the interval between stripes for the striped color map.
  1593. X.ti 10
  1594. X(I) Increment the interval between stripes for the striped color map.
  1595. X.ti 10
  1596. X(K) Decrease value exponents are compared against by 0.05.
  1597. X.ti 10
  1598. X(J) Increase value exponents are compared against by 0.05.
  1599. X.ti 10
  1600. X(M) Decrease value exponents are compared against by 0.005.
  1601. X.ti 10
  1602. X(N) Increase value exponents are compared against by 0.005.
  1603. X.ti 10
  1604. X(m) Increment the map index, changing the map to be iterated.
  1605. X.ti 10
  1606. X(P or p) Toggle positive/negative exponent display.
  1607. X.ti 10
  1608. X(r) Redraw the window using previously calculated exponents.
  1609. X.ti 10
  1610. X(R) Redraw the window using the newly set dwell and/or settle values.
  1611. X.ti 10
  1612. X(S) Spin the color wheel
  1613. X.ti 10
  1614. X(s) Halve the length of the spin and spin the color wheel
  1615. X.ti 10
  1616. X(u) Go up to the window just prior to the most recent zoom.
  1617. X.ti 10
  1618. X(U) Go all the way up to the original window.
  1619. X.ti 10
  1620. X(V or v) Display values of various parameters currently in use
  1621. X.ti 10
  1622. X(W or w) Use next color map.
  1623. X.ti 10
  1624. X(<ctrl>-W) Use color map in $HOME/.lyapmap
  1625. X.ti 10
  1626. X(X or x) Clear window
  1627. X.ti 10
  1628. X(Q or q) quit
  1629. X.sp 2
  1630. X.SH AUTHOR
  1631. X.nf
  1632. X        Ronald Joe Record
  1633. X     The Santa Cruz Operation 
  1634. X          P.O. Box 1900
  1635. X       Santa Cruz, CA 95061
  1636. X            rr@sco.com
  1637. X.fi
  1638. X.sp 2
  1639. X.SH ACKNOWLEDGEMENTS
  1640. X.PP
  1641. XThe algorithm was taken from the September 1991 Scientific American article
  1642. Xby A. K. Dewdney who gives credit to Mario Markus of the Max Planck Institute
  1643. Xfor its creation. Additional information and ideas were gleaned from the
  1644. Xdiscussion on alt.fractals involving Stephen Hall, Ed Kubaitis, Dave Platt
  1645. Xand Baback Moghaddam. Assistance with colormaps and spinning color wheels
  1646. Xand X was gleaned from Hiram Clawson. Rubber banding code was adapted from
  1647. Xan existing Mandelbrot program written by Stacey Campbell.
  1648. END_OF_FILE
  1649.   if test 7420 -ne `wc -c <'lyap/lyap.man'`; then
  1650.     echo shar: \"'lyap/lyap.man'\" unpacked with wrong size!
  1651.   fi
  1652.   # end of 'lyap/lyap.man'
  1653. fi
  1654. if test -f 'lyap/params/circle-4' -a "${1}" != "-c" ; then 
  1655.   echo shar: Will not clobber existing file \"'lyap/params/circle-4'\"
  1656. else
  1657.   echo shar: Extracting \"'lyap/params/circle-4'\" \(56 characters\)
  1658.   sed "s/^X//" >'lyap/params/circle-4' <<'END_OF_FILE'
  1659. X
  1660. Xlyap -f abbb -m 1 -D 400 -S 200 -W 256 -H 256 -M -0.85
  1661. END_OF_FILE
  1662.   if test 56 -ne `wc -c <'lyap/params/circle-4'`; then
  1663.     echo shar: \"'lyap/params/circle-4'\" unpacked with wrong size!
  1664.   fi
  1665.   # end of 'lyap/params/circle-4'
  1666. fi
  1667. echo shar: End of archive 2 \(of 3\).
  1668. cp /dev/null ark2isdone
  1669. MISSING=""
  1670. for I in 1 2 3 ; do
  1671.     if test ! -f ark${I}isdone ; then
  1672.     MISSING="${MISSING} ${I}"
  1673.     fi
  1674. done
  1675. if test "${MISSING}" = "" ; then
  1676.     echo You have unpacked all 3 archives.
  1677.     rm -f ark[1-9]isdone
  1678. else
  1679.     echo You still must unpack the following archives:
  1680.     echo "        " ${MISSING}
  1681. fi
  1682. exit 0
  1683. exit 0 # Just in case...
  1684. -- 
  1685.   // chris@Sterling.COM           | Send comp.sources.x submissions to:
  1686. \X/  Amiga - The only way to fly! |    sources-x@sterling.com
  1687.  "It's intuitively obvious to the |
  1688.   most casual observer..."        | GCS d+/-- p+ c++ l+ m+ s++/+ g+ w+ t+ r+ x+
  1689.