/usr/share/xcircuit/sinusoid.tcl is in xcircuit 3.8.78.dfsg-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 | proc sinusoid {a b {c 1.0}} {
set mylist {}
for {set t 0} {$t < [expr int(50.0 * $c)]} {incr t} {
set x [expr int($b * $t / 50.0)]
set y [expr int($a * sin(2 * 3.1415926 * $t / 50.0))]
lappend mylist [list $x $y]
}
set handle [eval polygon make [llength $mylist] $mylist]
refresh
return $handle
}
|