Class IsoscelesTriangle

java.lang.Object
  |
  +--IsoscelesTriangle

public class IsoscelesTriangle
extends java.lang.Object

A class that manages an Isosceles triangle (a triangle with 2 equal sides) given the base (the non-equal side) and the height.


Constructor Summary
IsoscelesTriangle(double base, double height)
          Create a new Isosceles triangle object given the base and height of the triangle.
 
Method Summary
 double getArea()
          Return the area of the triangle.
 double getBase()
          Return the base of the triangle.
 double getHeight()
          Return the height of the triangle.
 double getPerimeter()
          Return the perimeter of the triangle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IsoscelesTriangle

public IsoscelesTriangle(double base,
                         double height)
Create a new Isosceles triangle object given the base and height of the triangle.
Parameters:
double - base of the triangle (non-equal side). Must be greater than 0.
double - height of the triangle. Must be greater than 0.
Method Detail

getBase

public double getBase()
Return the base of the triangle.
Returns:
base of the triangle.

getHeight

public double getHeight()
Return the height of the triangle.
Returns:
height of the triangle.

getPerimeter

public double getPerimeter()
Return the perimeter of the triangle.
Returns:
the perimeter of the triangle.

getArea

public double getArea()
Return the area of the triangle.
Returns:
the area of the triangle.