Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can't compile FSin trig function
#3
Thanks, that has resolved the compilation issue. However, the maths doesn't seem correct for this fSin function. My sample FOR loop below should draw a sine wave across the screen.
Code:
REM SINCLAIR BASIC SIN (radians)
10 FOR d=0 TO 255: PLOT d,90: LET r=(d+90)*PI/180: DRAW 0,64*(SIN r): NEXT d

[Image: attachment.php?aid=306]

.png   SIN - Sinclair BASIC.png (Size: 3.82 KB / Downloads: 1,912)


Code:
REM BORIEL BASIC fSIN (degrees)
FOR d=0 TO 255: PLOT d,90: DRAW 0,64*(fSin (d+90)): NEXT d

[Image: attachment.php?aid=305]

.png   fSin - Boriel BASIC.png (Size: 4 KB / Downloads: 1,890)


In both cases I have offset the sine wave by 90 degrees on the X axis. Notice that the fSIN pattern seems to break and reset just as it prepares to enter the fourth quad (but slightly before the symmetry point) of the pre-calculated table.
Reply


Messages In This Thread
Can't compile FSin trig function - by patters - 12-28-2020, 01:43 AM
RE: Can't compile FSin trig function - by boriel - 12-28-2020, 09:04 AM
RE: Can't compile FSin trig function - by patters - 12-28-2020, 12:17 PM
RE: Can't compile FSin trig function - by boriel - 12-28-2020, 04:28 PM
RE: Can't compile FSin trig function - by patters - 12-28-2020, 06:05 PM
RE: Can't compile FSin trig function - by boriel - 12-28-2020, 10:58 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)