One more check on valid display which is known to be in the startup
[xcircuit.git] / lib / tcl / sinusoid.tcl
blob1e74e7e5d1100523e32f6b9820eca46de3d18254
1 proc sinusoid {a b {c 1.0}} {
2 set mylist {}
3 for {set t 0} {$t < [expr int(50.0 * $c)]} {incr t} {
4 set x [expr int($b * $t / 50.0)]
5 set y [expr int($a * sin(2 * 3.1415926 * $t / 50.0))]
6 lappend mylist [list $x $y]
8 set handle [eval polygon make [llength $mylist] $mylist]
9 refresh
10 return $handle