{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Tetrahedron - Tetrahedron.java Author Lewis/Loftus...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
//****************************************************************************** // Tetrahedron.java Author: Lewis/Loftus // // Represents a pyramid with a triangle as the base. //****************************************************************************** / public class Tetrahedron extends Triangle { private double height; //--------------------------------------------------------------------------- // Sets up the pyramid by entering its base side length and height //--------------------------------------------------------------------------- public Tetrahedron(double sid, double hei) { super(sid); height = hei; } //--------------------------------------------------------------------------- // Returns the double value of the height //--------------------------------------------------------------------------- public double getPyramidHeight() { return height; } //--------------------------------------------------------------------------- // Returns the calculated value of a face height //--------------------------------------------------------------------------- public double faceHeight() { return Math.sqrt(Math.pow(height, 2) + Math.pow(getHeight() / 2, 2)); } //---------------------------------------------------------------------------
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}