Write as follows in order to kill divide by zero error.
D=SQR(POW(X2-X,2)+POW(Y2-Y,2))
IF D>0 THEN X2=X2+(X2-X)/D:Y2=Y2-(Y2-Y)/D
The following code is another solution.
D=SQR(POW(X2-X,2)+POW(Y2-Y,2))
IF D>0 THEN
A=ATAN(Y-Y2,X-X2)
X2=X2+COS(A):Y2=Y2+SIN(A)
ENDIF
1そうだね 未プレイ