fixes, more trig, demo with floats

This commit is contained in:
2020-10-20 00:26:08 +02:00
parent 68c9b33637
commit 9723ac72be
9 changed files with 421 additions and 50 deletions
+34
View File
@@ -0,0 +1,34 @@
(
; mouse over the image to draw circles
(sc-init 800 600)
(sc-opt SCREEN_AUTO_BLIT 0)
(:loop)
(sc-poll)
(sc-mouse r4 r5 (ov? (j :loop)))
(itf r4)
(itf r5)
(ld r0 0.0)
(def RADIUS 50.0)
(:circle)
(fsin r1 r0)
(fcos r2 r0)
(fmul r1 RADIUS)
(fmul r2 RADIUS)
(fadd r1 r4)
(fadd r2 r5)
(fti r1)
(fti r2)
(sc-px r1 r2 #66ff00)
(fadd r0 0.1) ; make lower for a smoother circle
(fcmp r0 TAU
(ge?
(sc-blit)
(j :loop)))
(j :circle)
(j :loop)
)