I'm trying to write a code in Prolog to count the distance between two points but when I tried to execute it , it told me that out of local stack any body know what that means and how i can solve it this my code by the way:
point(a,5,2).
point(b,4,0).
point(c,2,3).
point(d,5,2).
distance(N1,N2,D) :-
distance(point(N1,X1,Y2),point(N2,X2,Y2),Z),
Z=sqrt(((X1-X2)*(X1-X2))+((Y1-Y2)*(Y1-Y2))).
line(N1,N2,D) :-
distance(N1,N2,Z).
tangent(X,Y,M) :-
tangent(point(N1,X1,Y2),point(N2,X2,Y2),M),
M=(Y1-Y2)/(X1-X2).