I have traced a set of triangles - windows on a curved building - and recorded them as a set of corner coordinates for each triangle. In reality, each triangle is an equally sized equilateral triangle, but in the photo each triangle is 'projected' differently based on the angle of the building. I'm trying to work out how to take the 'source triangle' shape and project it to match the triangle shape as seen in the photo.
Each triangle's orientation is the same (all 'up-pointing').
I imagine the solution will be something like a bounding box + a 'skew' amount (I'm imagining a +/- degrees of the length of the side) for each axis. Alternately, I believe skewing in two dimensions is the same as skew in one dimension + rotation of the whole shape.
So - I think this gives four values for the solution:
- Scale X (%)
- Scale Y (%)
- Skew (°)
- Rotation (°)
Is there a straightforward way to determine these four values given the corner coordinates for the target triangle?

Suppose the coordinates of the initial bounding box were (in order) $(x_1, y_1)$, $(x_2, y_1)$, $(x_2, y_2)$, $(x_1, y_2)$ with $(x_1, y_1)$ being the left lower corner. I will perform all operations relative to this and the new box will have the same lower left corner.
Also note that throughout these operations we will be have a parallelogram box so, given three corners one can always determine the last (by using the fact that midpoints of opposite corners must coincide). So I will not describe the mapping of the upper-right corner $(x_2, y_2)$ (since it will be deducible).
After scaling along $y$ by $\alpha_y$ and $x$ by $\alpha_x$ ($\alpha_x, \alpha_y>0$)
If the scales are in percentages, we divide by $100$ to get fractions which these $\alpha$s are. $$\begin{bmatrix}x_1& y_1\\ x_2& y_1\\ x_1& y_2\end{bmatrix}\longrightarrow \begin{bmatrix}x_1& y_1\\ x_1+\alpha_x(x_2-x_1)& y_1\\ x_1& y_1+\alpha_y(y_2-y_1)\end{bmatrix}$$
After skewing by $\omega$ ($-90^{\circ}<\omega<90^{\circ}$)
By this I mean, the angle at $(x_1, y_1)$ will now become $90^{\circ}+\omega$ while the lower-right vertex stays $$\begin{bmatrix}x_1& y_1\\ x_1+\alpha_x(x_2-x_1)& y_1\\ x_1& y_1+\alpha_y(y_2-y_1)\end{bmatrix}\longrightarrow\begin{bmatrix}x_1& y_1\\ x_1+\alpha_x(x_2-x_1)& y_1\\ x_1+\alpha_y(y_2-y_1)\cdot\cos(90^{\circ}+\omega)& y_1+\alpha_y(y_2-y_1)\cdot\sin(90^{\circ}+\omega)\end{bmatrix}$$
After rotating by $\theta$ ($-90^{\circ}<\theta<90^{\circ}$)
By this I mean rotating the whole parallelogram counter-clockwise by $\theta$. We are not considering the other angles because that would change the choice of lower-left vertex itself i.e. if we choose the mapping of the lower-left vertex correctly, this will be the domain
Simplifying using rotation matrix and using trigonometric identities, we get: $$\longrightarrow\begin{bmatrix}x_1& y_1\\ x_1+\alpha_x(x_2-x_1)\cdot\cos\theta& y_1+\alpha_x(x_2-x_1)\cdot\sin\theta\\ x_1+\alpha_y(y_2-y_1)\cdot\cos(90^{\circ}+\omega+\theta)& y_1+\alpha_y(y_2-y_1)\cdot\sin(90^{\circ}+\omega+\theta)\end{bmatrix}$$
To get the parameters from the target:
Thus if we wish to get from target (capital letters, ignoring the upper-right corner again) to source (lower letters): $$\begin{bmatrix}X_1& Y_1\\ X_2& Y_2\\ X_3& Y_3\end{bmatrix}\longrightarrow \begin{bmatrix}x_1& y_1\\ x_2& y_1\\ x_1& y_2\end{bmatrix}$$
Then: $$\alpha_x = \frac{\sqrt{(X_2-X_1)^2+(Y_2-Y_1)^2}}{x_2-x_1}$$ $$\alpha_y = \frac{\sqrt{(X_3-X_1)^2+(Y_3-Y_1)^2}}{y_2-y_1}$$ $$\tan\theta=\frac{Y_2-Y_1}{X_2-X1}\quad \text{ (uniquely determines $\theta$ in its range)}$$ $$\sin(90^{\circ}+\omega+\theta)=\frac{Y_3-Y_1}{\sqrt{(X_3-X_1)^2+(Y_3-Y_1)^2}}$$ $$\cos(90^{\circ}+\omega+\theta)=\frac{X_3-X_1}{\sqrt{(X_3-X_1)^2+(Y_3-Y_1)^2}}\quad \text{ (together uniquely determine $\omega$ in the range of length $180^\circ$)}$$