I wrote a program on the PROLOGUE, which determines whether a point with coordinates fell into a circle. The program displays correctly if the point in the circle, and if not, it still displays "Falls", and the point is not in the circle.
I give the code, please tell me what's wrong.
domains n=real predicates proverka(n,n,n,n,n) proverka1(n,n,n,n,n) clauses proverka(X,Y,Xc,Yc,R):- sqrt((X-Xc)*(X-Xc) + (Y-Yc)*(Y-Yc))<=R*R, write("Popadaet"). proverka1(X,Y,Xc,Yc,R):- sqrt((X-Xc)*(X-Xc) + (Y-Yc)*(Y-Yc))>R*R, write("Ne popadaet"). goal write("Vvedite X= "),readreal(X), write("Vvedite Y= "),readreal(Xc), write("Vvedite Xc= "),readreal(Y), write("Vvedite Yc= "),readreal(Yc), write("Vvedite R= "),readreal(R),proverka(X,Y,Xc,Yc,R),proverka1(X,Y,Xc,Yc,R).
R*R? Compare dimensions / units. - D-sideX^2+y^2 <= R^2