static      up
blank.gif (811 bytes)
5a
m.gif (1431 bytes) sincos.gif (6424 bytes) palmer.gif (3094 bytes)
flyti.gif (1659 bytes)
blank.gif (811 bytes)
down
blank.gif (811 bytes)
home

 


Using real sinusoidals, generate a shape with primarily convex properties.

#
# a collection of sin waves, from the flat in the background
# to the "3D" in the center and front

import math
g.antialias(100)
g.norefresh()

for m in range(1, 100):
 g.pen(10)
 angle = (m / 90.0) * math.pi
 radius = m
 x = int(m + math.cos(angle)/radius)
 y = int(50 + math.sin(angle)*radius)
 g.line(m, 10, m, y)

 g.pen(m)
 angle = (m / 50.0) * math.pi
 radius = m
 x = int(m + math.cos(angle)/radius)
 y = int(100 + math.sin(angle)*radius)
 g.line(30, 30, m, y)

 g.pen(40)
 angle = (m / 30.0) * math.pi
 radius = 11
 x = int(m + math.cos(angle)/radius)
 y = int(10 + math.sin(angle)*radius)
 g.line(0, 0, m, y)
 
 g.pen(20)
 angle = (m / 50.0) * math.pi
 radius = m
 x = int(m + math.cos(angle)/radius)
 y = int(25 + math.sin(angle)*radius)
 g.line(m, 10, m, y)
 
 g.refresh()