used prototype to add method to object constructed with triangle constructor