What is a house shape?
A house shape is a rectangle of width a and wall height h with an isosceles triangle standing on its top side: the roof. The roof triangle has the same base a, height t and two equal roof sides s, so the outline is a pentagon with total height H = h + t. The roof pitch θ is the angle between a roof side and the horizontal.
How to use it
Choose what you know: the width, the wall height and either the total height, one roof side or the roof pitch (in degrees or radians). The length unit is only a label: lengths come out in that unit and areas in its square. Each length you type must be from 0.000001 to 1,000,000,000 (boxes that allow 0 also accept 0), and a roof pitch from 0.000001 up to but not including 90° (π/2 rad); anything else, including text, is refused instead of being read as something else.
Derivation of the formulas
The roof half is a right triangle with legs a/2 and t and hypotenuse s, so
$$t = H - h,\qquad s = \sqrt{\left(\tfrac{a}{2}\right)^2 + t^2},\qquad \tan\theta = \frac{2t}{a},\qquad t = \tfrac{a}{2}\tan\theta$$
The area adds the rectangle and the triangle; the perimeter is the outline only (the line between walls and roof is inside the shape):
$$A = a\,h + \tfrac12\,a\,t,\qquad P = a + 2h + 2s,\qquad \text{ridge angle} = 180^\circ - 2\theta$$
The centroid lies on the axis of symmetry at the area-weighted mean of the rectangle's centre (h/2) and the triangle's centroid (h + t/3):
$$\bar y = \frac{a h \cdot \tfrac{h}{2} + \tfrac12 a t\,(h + \tfrac{t}{3})}{A}$$
Worked example
The page opens with width a = 8, wall height h = 5, total height H = 8. Then area A = 52; perimeter P = 28; roof side s = 5; roof pitch θ = 36.869898° (shown to at most six decimals; see the precision note in the FAQ).
FAQ
What if the wall height is 0?
Then nothing is left of the rectangle and the shape is the isosceles roof triangle alone; the page says so and still gives every value.
Why must the total height exceed the wall height?
The difference is the roof height t. With t = 0 there is no roof, so the calculator asks for a larger total height.
Why does the unit not change the numbers?
The calculator does not convert between units. Every length is read in the unit you chose, so the unit only labels the results; areas come out in that unit squared.
How precise are the results?
Results are accurate to at least 9 significant digits for ordinary inputs. When a result depends on the small difference of two nearly equal entries (closer than one part in a million), fewer digits are reliable. The page shows up to six decimals; a value too small or too large for that is written out as a plain number instead.
References
Zwillinger, D. (ed.), CRC Standard Mathematical Tables and Formulae, 33rd ed., 2018