sandbox/pe/geometry.erl

12 lines
195 B
Erlang
Raw Permalink Normal View History

2019-04-22 02:25:01 +00:00
-module(geometry).
-export([area/1]).
area({rectangle, Width, Height}) ->
Width * Height;
area({circle, Radius}) ->
3.14159 * Radius * Radius;
area({square, Side}) ->
Side * Side.