# Plot a Lissajou Patterns in Xcircuit

# constants
set xscale 144
set yscale 144
set pi 3.1415926

# curve parameters
set m 4
set n 3
set c .3*$pi

# generate the curve
set t 0
set list ""
set N 0

while { $t <= 1 } {
	set x [expr sin(2*$pi*$m*$t+$c)]
	set y [expr sin(2*$pi*$n*$t)]

	set xx [expr int($x * $xscale)]
	set yy [expr int($y * $yscale)]

	set list [concat $list \{$xx $yy\}]

	set N [expr $N + 1]
	set t [expr $t + .005]
}

# plot it
eval polygon make $N $list
