home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
aminet
/
jdlib4_6.lha
/
Procs
/
_Bezier.AMOS
/
_Bezier.amosSourceCode
Wrap
AMOS Source Code
|
2008-12-10
|
558b
|
33 lines
Screen Open 0,640,256,4,Hires
Dim K(3,1)
Global K()
Data 100,50,250,250,100,250,250,50
Ink 4
For I=0 To 3
Read K(I,0),K(I,1)
Plot K(I,0),K(I,1)
Next
Ink 2
BEZIER[20]
Wait Key
End
Procedure BEZIER[S]
S#=S
Dim P(3,3,1)
For I=0 To 3
P(I,0,0)=K(I,0)
P(I,0,1)=K(I,1)
Next
M#=0.0
Plot K(0,0),K(0,1)
While M#<=1
M#=M#+1.0/S#
For J=1 To 3
For I=0 To 3-J
P(I,J,0)=P(I,J-1,0)+M#*(P(I+1,J-1,0)-P(I,J-1,0))
P(I,J,1)=P(I,J-1,1)+M#*(P(I+1,J-1,1)-P(I,J-1,1))
Next
Next
Polyline To P(0,3,0),P(0,3,1)
Wend
End Proc