Loading ...
Sorry, an error occurred while loading the content.

38618Re: [libertybasic] Re: SINE WAVE

Expand Messages
  • Henrik
    Jul 6 2:29 PM
    • 0 Attachment
      Thanks to Patric 

      --- On Mon, 7/6/09, Patric t'Kindt <tkpatric@...> wrote:


      From: Patric t'Kindt <tkpatric@...>
      Subject: Re: [libertybasic] Re: SINE WAVE
      To: libertybasic@yahoogroups.com
      Date: Monday, July 6, 2009, 5:50 PM








      This is a nice application for sinusses, Lissajous:

      nomainwin
      TextboxColor$ = "yellow"
      textbox #Meten.a, 630, 15, 150, 26
      textbox #Meten.b, 630, 45, 150, 26
      textbox #Meten.c, 630, 75, 150, 26
      open "Meten" for graphics_fs_ nsb as #Meten
      pie = 3.1428
      print #Meten, "trapclose [einde]"
      [begin]
      print #Meten, "fill palegray"
      prompt "Frequentie sin1"; aant1$
      prompt "Frequentie sin2"; aant2$
      prompt "Phaseshift sin2"; fa$
      aant1=val(aant1$ )
      aant2=val(aant2$ )
      fa=val(fa$)
      faze=(fa/180) *pie
      IF aant1 = 0 AND aant2 = 0 THEN goto [einde]
      gosub [assen]
      print #Meten, "size 1"
      x=0: y= 0
      print #Meten, "place "; 0 ; " "; 120
            print #Meten, "color darkcyan": print #Meten, "down"
            FOR n = 0 TO 360
               x = n*2/3
               y = SIN(aant1 * (n/180*pie)) * 120 + 120
             print #Meten, "goto "; x ; " "; y
            NEXT n
      x=450: y= 200
      print #Meten, "up": print #Meten, "place "; SIN(faze) * 120 + 360 ; " "; 240
            print #Meten, "color blue": print #Meten, "down"
            FOR n = 0 TO 360
               y = n*2/3 +240
               x = SIN(aant2 * (n/180*pie) + faze) * 120 + 360
              print #Meten, "goto "; x ; " "; y
            NEXT n
      x=450: y=100
      print #Meten, "up": print #Meten, "place "; SIN(faze) * 120 + 360  ; " "; 120
            print #Meten, "color red": print #Meten, "down"
            FOR n = 0 TO 360
              x = SIN(aant2 * (n/180*pie) + faze) * 120 + 360
              y = SIN(aant1 * (n/180*pie)) * 120 + 120
               print #Meten, "goto "; x ; " "; y
       '******* delay *******
      for del=1 to 2000: next del
            NEXT n
      print #Meten, "up": print #Meten, "place "; x ; " "; y
      gosub [assen]
      gosub[wacht]
      gosub [begin]
      GOTO [einde]
      [assen]
      print #Meten, "size 2"
      print #Meten, "color black": print #Meten, "down"
      print #Meten, "line "; 0; " "; 240; " "; 480; " "; 240
      print #Meten, "line "; 240; " "; 0; " "; 240; " "; 480
      print #Meten, "line "; 0; " "; 120; " "; 480; " "; 120
      print #Meten, "line "; 360; " "; 0; " "; 360; " "; 480
      print #Meten, "line "; 480; " "; 480; " "; 480; " "; 0
      print #Meten, "line "; 0; " "; 480; " "; 480; " "; 480
      print #Meten.a, "Freq. sin1 = "; aant1
      print #Meten.b, "Freq. sin2 = "; aant2
      print #Meten.c, "Phaseshift = "; fa
      return
      [wacht]
      print #Meten, "setfocus; when characterInput [begin]"
      scan
      goto [wacht]
      [einde]
      beep
      close #Meten
      end

      [Non-text portions of this message have been removed]



















      [Non-text portions of this message have been removed]
    • Show all 19 messages in this topic