12 lines
195 B
Erlang
12 lines
195 B
Erlang
|
-module(geometry).
|
||
|
-export([area/1]).
|
||
|
|
||
|
area({rectangle, Width, Height}) ->
|
||
|
Width * Height;
|
||
|
area({circle, Radius}) ->
|
||
|
3.14159 * Radius * Radius;
|
||
|
area({square, Side}) ->
|
||
|
Side * Side.
|
||
|
|
||
|
|