home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 1
/
GoldFishApril1994_CD1.img
/
d1xx
/
d105
/
basicprogs
/
curves
(
.txt
)
< prev
next >
Wrap
AmigaBASIC Source Code
|
1987-10-25
|
5KB
|
212 lines
' Conplex Curves by George Trepal copyright 1987
'I got the idea for this program from the April 1967
'Clemson Chronicle which is the student magazine of Clemson
'University. The Chronicle was not copyrighted however this
'program is copyright 1987 to George Trepal. This is a public
'domain program Ok to give or distribute for a small fee
'but not to sell.
over = 40: Yadjust = 380
SCREEN 2,640,400,2,4
WINDOW 2, "",,0,2
GOSUB Originshifts
PALETTE 0, 0,0,0
PALETTE 1, 0,0,0
PALETTE 2, 0.5,0.15,0.15
PALETTE 3, 0.91,0.48,0.15
COLOR 2,0
FOR j = 0 TO 380 STEP 20: ' Y axis
LINE (80,j) - (240,j)
NEXT
FOR j = 80 TO 240 STEP 20: ' X axis
LINE (j,0) - (j,380)
NEXT
COLOR 3,0
LOCATE 3,1
PRINT TAB(over + 6) "COMPLEX CURVES"
COLOR 2,0
LOCATE 5,1
PRINT TAB(over) "r = 4[SIN(theta - 1) + 1]"
PRINT TAB(over + 2) "between 0 and 6.28"
FOR theta = 0 TO 6.28 STEP 0.02
r = 4 * (SIN(theta - 1) + 1)
x = (r * COS(theta)) * 10 + OrigX(1) + 80
y = Yadjust - ((r * SIN(theta)) * 10 + OrigY(1))
PSET (x,y),3
NEXT
p = 2
PRINT TAB(over) "x = -[(y/1.5)^4 - (y/1.5)^2]"
PRINT TAB(over + 3) "between -2 and 1.5"
FOR y = -2 TO 1.5 STEP 0.05: ' face
x = -((y/1.5)^4 - (y/1.5)^2)
GOSUB Setpoints0
NEXT
p = 3
PRINT TAB(over) "y = -x^3/2"
PRINT TAB(over + 2) "between -1.6 and 1.5"
FOR x = -1.6 TO 1.5 STEP 0.05: ' front of neck
y = -(x^3/2)
GOSUB Setpoints0
NEXT
p = 4
PRINT TAB(over) "x = 10.5"
PRINT TAB(over + 2) "between 17 and 24.8"
FOR y = 17 TO 24.8 STEP 0.1: ' front of nearside arm
x = 10.5
GOSUB Setpoints0
NEXT
p = 5
PRINT TAB(over) "y = -7x"
PRINT TAB(over + 2) "between 0 and 1"
FOR x = 0 TO 1 STEP 0.01: ' back of nearside arm
y = -7 * x
GOSUB Setpoints0
NEXT
p = 6
PRINT TAB(over) "y = -SQR(5x)"
PRINT TAB(over + 2) "between .5 and 5"
FOR x = 0.5 TO 5 STEP 0.1: ' top of breast
y = -SQR(5 * x)
GOSUB Setpoints0
NEXT
p = 7
PRINT TAB(over) "y = -SQR(6.25 - x^2)"
PRINT TAB(over + 2) "between -1 and 2.5"
FOR x = -1 TO 2.5 STEP 0.05: ' underside of breast
y = -SQR(6.25 - x^2)
GOSUB Setpoints0
NEXT
p = 8
PRINT TAB(over) "y = x^2/4"
PRINT TAB(over + 2) "between -4 and -2.4"
FOR x = -4 TO - 2.4 STEP 0.05: ' lower farside arm
y = 0.25 * x^2
GOSUB Setpoints0
NEXT
p = 8
PRINT TAB(over) "y = x^2/4"
PRINT TAB(over + 2) "between 4 and 5"
FOR x = 4 TO 5 STEP 0.05: ' chest
y = 0.25 * x^2
GOSUB Setpoints0
NEXT
p = 9
PRINT TAB(over) "x = -y^2/64"
PRINT TAB (over + 2) "between -8 and 8"
FOR y = -8 TO 8 STEP 0.1: ' belly and front of legs
x = -1/64 * y^2
GOSUB Setpoints0
NEXT
p = 10
PRINT TAB(over) "y = .47x^3 -x^2/2 + 1.03x"
PRINT TAB(over + 2) "between -1 and 1.5"
FOR x = -1 TO 1.5 STEP 0.05: ' back of neck
y = 0.47 * x^3 - 0.5 * x^2 + 1.03 * x
GOSUB Setpoints0
NEXT
p = 11
PRINT TAB(over) "y = x^2"
PRINT TAB (over + 2) "between -5 and -4.2"
FOR x = -5 TO -4.2 STEP 0.01: ' back of farside arm
y = x^2
GOSUB Setpoints0
NEXT
p = 11
PRINT TAB(over) "y = x^2"
PRINT TAB(over + 2) "between -2.3 and -1"
FOR x = -2.3 TO -1 STEP 0.01: ' back of leg
y = x^2
GOSUB Setpoints0
NEXT
p = 12
PRINT TAB(over) "x = SIN(3.14 * y/7)"
PRINT TAB(over + 2) "between -7.5 and 0"
FOR y = -7.5 TO 0 STEP 0.05: ' nearside cheek
x = SIN(3.14 * y/7)
GOSUB Setpoints0
NEXT
p = 12
PRINT TAB(over) "x = SIN(3.14 * y/7)"
PRINT TAB(over + 2) "between 3 and 13"
FOR y = 3 TO 13 STEP 0.05: ' spine
x = SIN(3.14 * y/7)
GOSUB Setpoints0
NEXT
p = 13
PRINT TAB(over) "y = -7x"
PRINT TAB(over + 2) "between -.7 and 0"
FOR x = -0.7 TO 0 STEP 0.01: ' lower back
y = -7 * x
GOSUB Setpoints0
NEXT
PRINT TAB(over) "y = .65x^2 - 6.9x + 22.2"
PRINT TAB (over + 2) "between 2.8 and 5.6"
FOR x = 2.8 TO 5.6 STEP 0.05: ' lower ass
y = 0.647 * x^2 - 6.9 * x + 22.24
GOSUB Setpoints1
NEXT
PRINT TAB(over) "y = .66x^3 - 8.8x^2 + 40x - 49.5"
PRINT TAB(over + 2) "between 2.8 and 5.5"
FOR x = 2.8 TO 5.5 STEP 0.05: ' lower back
y = 0.663 * x^3 - 8.83 * x^2 + 40.1 * x -49.5
GOSUB Setpoints1
NEXT
PRINT TAB(over) "y = -.32x^2 + 6.8x - 19.5"
PRINT TAB(over + 2) "between .8 and 1.04"
FOR x = 8.1 TO 10.4 STEP 0.1: ' close off arm
y = -0.322 * x^2 + 6.87 * x - 19.5
GOSUB Setpoints1
NEXT
PRINT : PRINT TAB(over) "PRESS ANY KEY TO QUIT"
COLOR 3,0
PRINT : PRINT TAB(over - 4) "A PUBLIC DOMAIN PROGRAM BY GEORGE TREPAL"
Hold:
IF INKEY$ = "" THEN Hold
WINDOW CLOSE 2
SCREEN CLOSE 2
LIST
END
Originshifts:
DIM OrigX(13), OrigY(13)
FOR j = 1 TO 13
READ OrigX(j), OrigY(j)
NEXT
DATA 80,320,90,305,90,265,0,0,70,220
DATA 100,260,125,210,70,120,120,80,30,260
DATA 70,-10,50,120,60,0,155,55
RETURN
Setpoints0:
PSET (x * 10 + OrigX(p) + 80, Yadjust - (y * 10 + OrigY(p))),3
RETURN
Setpoints1:
PSET (x * 10 + 80, Yadjust - (y * 10)),3
RETURN