This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/Logtalk/examples/mi/space3.lgt

17 lines
217 B
Plaintext
Raw Normal View History

:- object(space(_X,_Y,_Z)).
:- public(distance/1).
:- mode(xyz(?nunber), one).
distance(Distance) :-
parameter(1, X),
parameter(2, Y),
parameter(3, Z),
Distance is sqrt(X*X+Y*Y+Z*Z).
:- end_object.