# Sandbox

(Redirected from NUCAPT:sandbox)
Let $A$ be the aspect ratio (the viewport's vertical length divided by the horizontal length), which we must find by iteratively approximating:
$\frac{\sum_{i=1}^n{\arctan \left(A \frac{\bar v_i}{\bar h_i}\right)\sqrt{\bar h_i^2+A^2\bar v_i^2}}}{\sum_{i=1}^n\sqrt{\bar h_i^2+A^2\bar v_i^2}}=45^\circ$;
where $\bar v_i=\frac{\ddot v_i}{\ddot v}$, with $\ddot v_i$ being the vertical length of the $i^{th}$ line segment and $\ddot v$ being the span (absolute value of "stop-start") of the whole Y axis. Both of these later values are in world coordinates.
($h$ terms are similar, but are for the horizontal component.)