| |
|
|
| sometimes need one The positions a designed amount of Points on of/ one line -
( differently as any spots on of/ one line: [...] )
{$cleq}
cls
long lops=lineOfNumPoints(1,1,3,3,4)
print "points:",long(lops,0)
whileloop 1,long(lops,0) {
print "ptx:",long(lops,loop*8)
print "pty:",long(lops,loop*8+4)
print "-"
}
globalFree(lops)
waitInput
end
nProc lineOfNumPoints(long x,y,xx,yy,cnt){
long data
if cnt>2 {
float fcnt=float(cnt-1),\
sx=float(xx-x)/fcnt,\
sy=float(yy-y)/fcnt,\
px=float(x),\
py=float(y)
data=dim(8+cnt*8)
long data&,0=cnt,0,x,y
sub cnt,2
long offs=16
whileLoop cnt {
px=px+sx
py=py+sy
long data&,offs=long(px),long(py)
add offs,8
}
long data&,offs=xx,yy
return data
} else if cnt<1 {
data=dim(8)
long data&,0=0
return data
} else if cnt==1 {
data=dim(16)
long data&,0=1,0,long(float(xx-x)*0.5),long(float(yy-y)*0.5)
return data
}
data=dim(24)
long data&,0=1,0,x,y,xx,yy
return data
}
|
|
|
| |
|
|