erlang Distance = distance(point:new(34, 78), point:new(67, -45)),
io:format("~.2f~n", [Distance]).
-module(distpts).
-export([start/0]).
-import(point, [distance/2]).
start() ->
Distance = distance(point:new(34, 78), point:new(67, -45)),
io:format("~.2f~n", [Distance]).
%
% FILE: point.hrl
%
% -record(point, {x, y}).
%
%
% FILE: point.erl
%
% -module(point).
% -export([new/0, new/2, distance/2]).
%
% -include("point.hrl").
%
% new() -> #point{x=0, y=0}.
% new(X, Y) -> #point{x=X, y=Y}.
%
% distance(#point{x=X1, y=Y1}, #point{x=X2, y=Y2}) -> math:sqrt((X2 - X1) * (X2 - X1) + (Y2 - Y1) * (Y2 - Y1));
% distance(_, _) -> throw(badarg).
%