All online tools use javascript to calculate the dimensions. Use at your own risk. If the answers look wrong
then verify the answers with a calculator.
This octagon bay window rafter script - calculator will return the octagon baywindow geometry angles and trigonometry rafter
measurements for a Joe Carola unequal pitch type of baywindow roof framing with offset bay hips and dog leg valleys. The script
is limited to 45° baywindow calculations. The plate line must meet at 45° at the two intersecting corners.
The span is taken at the intersecting 45 walls to the main building plate line.
The span for the common rafters is the typical: span = side projection * 2 + the face wall length.
The front face wall common rafter run is then calculated with the trigonometry Law of Sines:
The sides of a triangle are proportional to the sine of the opposite angle
sin(A) ÷ a = sin(B) ÷ b = sin(C) ÷ c
major_angle = atan (minor_pitch ÷ major_pitch);
minor_angle = atan (major_pitch ÷ minor_pitch);
minor_common_rafter_run = major_common_rafter_run × sin(minor_angle) ÷ sin(major_angle);
minor_common_rafter_run_to_fascia = major_common_rafter_run_to_fascia × sin(minor_angle)
÷ sin(major_angle);
This script was influenced by the math for irregular roof framing by Joe Bartok.
Joe has broken down the trigonometric Law of Sines in good roof cutting examples on his website.
It’s really nice to see someone who fully understands how to use trigonometry to calculate any angle in a
roof structure and share the math and drawings to help or roof cutters .( share == not for profit)
Joe Bartok's Irregular Roof Framing
To calculate the front bay hips, the script uses the face wall common rafter
run + overhang run, so that all calculations for the bay hips are from the
fascia line. The bay hips are not at 67.5° from the corners of the baywindow.
The bay hips are offset from the corners of the baywindow to keep the overhang
run equal on all sides of the baywindow. With this type of baywindow roof
framing the 4 bay hips are
NOT all at the same pitch and are
NOT the
same length. The valleys are running at a 45° to the main wall lines, with
two dog leg valleys connecting the valleys to the fascia line. The 45° side
wall king common is
NOT in the center of the 45° wall and is
NOT in
the center of the overhang fascia. With a typical 2' projection and 6' face
wall length the 45° wall king common is actually centered in front of the
offset bay hips on the face wall when drawn at a 90° on the 45° wall to the
center of the ridge.
These six geometry angles for the bay hip are greatly effected by the side
pitch, bay projection length, face wall length and overhang run. Just by
changing the overhang run from 12" to 18" will drastically change the geometry
angles for the bay hip.
- Bay Hip Rafter Run Bisect Angle
- Bay Hip Rafter Run Top Bisect Angle
- Bay Hip Rafter Run Adjacent Bisect Angle
- Bay Hip Rafter Run Top Adjacent Bisect Angle
- Wall Bay Hip Rafter Run Bisect Angle
- Wall Bay Hip Rafter Top Bisect Angle
To calculate the wall bay hip rafter run bisect angle we can use the hypotenuse
of a right triangle:
wall bay hip rafter run = hypotenuse( major common run , minor run - projection
)
wall bay hip rafter run bisect angle = 135° - arctan ( 45 wall common rafter
run ÷ (minor run - projection) )
To calculate the 45° wall common rafter angle we can use the hypotenuse of a
right triangle:
45° wall common rafter run to fascia = overhang + (sin ( wall bay hip rafter
run bisect angle ) × wall bay hip rafter run )
45° wall common rafter angle = arctan ( major common rafter rise from fascia
÷ 45° wall common rafter run to fascia )

joe-carola-unequal-pitch-baywindow.dxf
-- auto generated DXF CAD file of baywindow drawing each time script is run
joe-carola-unequal-pitch-baywindow.pl source
code for perl script that generates these baywindow calculations
dxf_header.txt DXF header text file used by this script