-
- aPyScript +="def coordCalculator(tmin, tmax, tstep): \n";
- aPyScript +=" coords = [] \n";
- aPyScript +=" while tmin <= tmax : \n";
- aPyScript +=" coords.append([X(tmin), Y(tmin), Z(tmin)]) \n";
- aPyScript +=" tmin = tmin + tstep \n";
- aPyScript +=" return coords \n";
-
+
+ if (theNewMethod)
+ {
+ aPyScript +="def coordCalculator(tmin, tmax, nstep): \n";
+ aPyScript +=" coords = [] \n";
+ aPyScript +=" tstep = (tmax - tmin) / nstep \n";
+ aPyScript +=" n = 0 \n";
+ aPyScript +=" while n <= nstep : \n";
+ aPyScript +=" t = tmin + n*tstep \n";
+ aPyScript +=" coords.append([X(t), Y(t), Z(t)]) \n";
+ aPyScript +=" n = n+1 \n";
+ aPyScript +=" return coords \n";
+ }
+ else
+ {
+ aPyScript +="def coordCalculator(tmin, tmax, tstep): \n";
+ aPyScript +=" coords = [] \n";
+ aPyScript +=" while tmin <= tmax : \n";
+ aPyScript +=" coords.append([X(tmin), Y(tmin), Z(tmin)]) \n";
+ aPyScript +=" tmin = tmin + tstep \n";
+ aPyScript +=" return coords \n";
+ }
+