Skip to main content
guest
Join | Help | Sign In
Liberty BASIC Community Wiki Home
guest| Join | Help | Sign In
Liberty BASIC Community Wiki
  • Wiki Home
  • Recent Changes
  • Pages and Files
  • Members
  • Home
    • Liberty BASIC FAQ
    • Contests
    • Tutorials
    • Science
    • Shared Code
    • Tips
    • DLLs
    • PublicDomainSprites
    • Member Pages
    • Links
    • Sandbox

Sin & Cos

Edit 0 1 …
  • 0 Tags
    • No tags
  • Notify
  • RSS
  • Backlinks
  • Source
  • Print
  • Export (PDF)
Older Version Newer Version

bluatigro bluatigro Apr 4, 2010

WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
sx = WindowWidth
sy = WindowHeight
''==============================================
prompt "Speed X 1 =" ; qa$
a = int( val( qa$ ) )
prompt "Speed Y 1 =" ; qb$
b = int( val( qb$ ) )
prompt "Speed X 2 =" ; qc$
c = int( val( qc$ ) )
prompt "Speed Y 2 =" ; qd$
d = int( val( qd$ ) )
prompt "Speed Color =" ; qe$
e = int( val( qe$ ) )
''==============================================
pi = atn( 1 ) * 4
wind$ = " | X1 = " + str$( a ) _
+ " | Y1 = " + str$( b ) _
+ " | X2 = " + str$( c ) _
+ " | Y2 = " + str$( d ) _
+ " | Color = " + str$( e ) + " |"
nomainwin
open "Speed" + wind$ for graphics as #m
#m , "trapclose [quit]"
#m , "fill black"
for i = 0 to pi * 2 step pi / 200
#m , "down"
#m , "color " ; sin( i * e ) * 127 + 128 _
; " " ; sin( i * e - 2 / 3 * pi ) * 127 + 128 _
; " " ; sin( i * e + 2 / 4 * pi ) * 127 + 128
#m , "line " ; sin( i * a ) * sx / 4 + sx / 2_
; " " ; cos( i * b ) * sy / 4 + sy / 2 _
; " " ; sin( i * c ) * sx / 4 + sin( i * a ) * sx / 4 + sx / 2 _
; " " ; cos( i * d ) * sy / 4 + cos( i * b ) * sy / 4 + sy / 2
#m , "up"
next i
#m , "flush"
wait
[quit]
close #m
end
Help · About · Pricing · Privacy · Terms · Support · Upgrade
Contributions to https://basic.wikispaces.com/ are licensed under a Creative Commons Attribution Share-Alike 2.5 License. Creative Commons Attribution Share-Alike 2.5 License
Portions not contributed by visitors are Copyright 2018 Tangient LLC
TES: The largest network of teachers in the world
Turn off "Getting Started"
  1. Home
  2. ...
Loading...