second.erl 267 B

123456789101112131415161718
  1. -module(second).
  2. -import (first, [mult/2, square/1]).
  3. -export([hypotenuse/2,
  4. perimeter/2,
  5. area/2]).
  6. hypotenuse(A,B) ->
  7. math:sqrt(square(A) + square(B)).
  8. perimeter(A,B) ->
  9. A + B + hypotenuse(A,B).
  10. area(A,B) ->
  11. mult(mult(A,B), 0.5).