我的 TCL 代码有问题。请帮我找到它。我已经花了8个小时。谢谢
set QA1 array()
set QA2 array()
set QA3 array()
set COUNTER1 0
set COUNTER2 0
proc K1Axes { x y z } {
global QA1
global QA2
global QA3
global COUNTER1
set fi [expr {2*4*atan(1.)*rand()}]
set q1 [expr {0.707*cos($fi)}]
set q2 [expr {0.707*sin($fi)}]
set q3 [expr {0.707}]
return [list $q1 $q2 $q3]
set QA1($COUNTER1) [expr {-$q1}]
set QA2($COUNTER1) [expr {-$q2}]
set QA3($COUNTER1) [expr {$q3}]
incr COUNTER1
}
proc K2Axes { x y z } {
global QA1
global QA2
global QA3
global COUNTER2
set qq1 QA1($COUNTER2)
set qq2 QA2($COUNTER2)
set qq3 QA3($COUNTER2)
return [list $qq1 $qq2 $qq3]
incr COUNTER2
}