Hello I am trying to shift points which have been previously generated in the square area. I am having a trouble with some additional conditions how they should have been shifted.
xt=x(j)+2*rand()*shift - shift
yt=y(j)+2*rand()*shift - shift
Also I have more conditions to apply:
a) xt<0
b)xt>a
c)yt<0
d)yt>a
d) the distance (x(i)-xt)**2+(y(i)-yt)**2 <1 for i=1,2,...n; i/=j
where x(i)
is a randomly generated number and shift
is a parameter in the interval [0.1,1].x(j)
is the randomly generated number again from the x(i)
array. y(j)
and y(i)
is the same as x
I would like to know if the conditions are not being executed should I go back to the generating xt
and yt
positions or what would be other way to carry out with this problem?