14.5 - isRound(Triangle = False area Shape> Float...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
--14.5 data Shape = Circle Float | Rectangle Float Float | Triangle Float Float Float perimeter :: Shape -> Float perimeter (Triangle x y z) = x+y+z isRound :: Shape -> Bool
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: isRound (Triangle _ _ _) = False area :: Shape -> Float area (Triangle x y z) = sqrt(s*(s-x)*(s-y)*(s-z)) where s = perimeter (Triangle x y z) / 2...
View Full Document

This note was uploaded on 11/10/2010 for the course CS 332F taught by Professor Russel during the Spring '10 term at California State University Los Angeles .

Ask a homework question - tutors are online