import { useWindStore } from '../../store/windStore';
export const RoofZonesDiagram = () => {
const { inputs } = useWindStore();
const { width: B, length: L } = inputs.dimensions;
// SVG scaling
const padding = 40;
const svgWidth = 300;
const svgHeight = 250;
// Normalize dimensions
const maxDim = Math.max(B, L);
const scale = (Math.min(svgWidth, svgHeight) - 2 * padding) / maxDim;
const sB = B * scale;
const sL = L * scale;
const startX = (svgWidth - sB) / 2;
const startY = (svgHeight - sL) / 2;
// a distance (end zone width)
// a = Max(Min(0.1*B, 0.4*h), 0.04*B, 3.00) usually.
// For now, let's estimate 'a' visually as 10% of B or L.
// We should implement specific 'a' calculation in logic, but for diagram we can approximate or use calculation if available.
// Let's approximate a = 0.1 * min(B, L)
const a_real = Math.max(Math.min(0.1 * B, 0.4 * 15), 0.04 * B, 3); // using h=15 approx
const a = a_real * scale;
return (
Roof Zones (ASCE 7 Figure 28.3-1)
Approx. End Zone Width a = {a_real.toFixed(1)} ft
);
};