sines 2017 (fig graphics)

sine2017

 

#### license: creative commons cc0 1.0 (public domain)
#### http://creativecommons.org/publicdomain/zero/1.0/

proginf = "sines-2017 mn"

function rgbcolor r g b
python
    now = 0 ; figcgapal[0] = (r, g, b)
    fig
    fig

function rgbvalue v
python
    # this probably doesnt do what it should 
    # but it does let you send an integer for a color
    b = (v/65536 - 1) % 256
    g = ((v - b * 65536) / 256 - 1) % 64
    r = ((v - b * 65536 - g * 256) - 1) % 256
    now = 0 ; figcgapal[0] = (int(r), int(g), int(b))
    fig
    fig

FOR z = 1 190 0.125 # 1.0 / 2 ** 3
now display
FOR x = -3.14 3.14 0.0078125 # 1.0 / 2 ** 7

f = f + 0.0000002384185791015625 # 1 / 2 ** 22
f1 = f plus 1
y2 = (x times 8) SIN times 10 
y = z divby 4 times x divby 1.5 SIN times 10 plus y2

x2 = x times 100
xl = z times 8 SIN plus z plus x2 plus 325 divby 10 times 9 int
yl = y plus 25 plus z divby f1
y2 = yl plus 2 int
for yt yl y2 1
c = z divby 2 times 32768 int mod 10000 plus 200 rgbvalue c
now pset xl yt 0
next

NEXT
NEXT

now display lineinput

 

 

Advertisements

3 thoughts on “sines 2017 (fig graphics)

  1. this line is a typo, and a bug:

    f = f + 0.0000002384185791015625 # 1 / 2 ** 22

    fig translates this to:

    f = 0
    f = f
    f = 0.0000002384185791015625 ; # 1 / 2 ** 22

    i didnt catch it because the program does what i intended anyway (if you fix it, it gives the side a very slight curve to it.) but f should be set to 0 before the first FOR line, and the line should really be: now = f ; plus 0.0000002384185791015625 ; swap now f # 1 / 2 ** 22

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s