I am trying to calculate the components of a variable in the global coordinate system in another local coordinate system.
Essentially, I am solving a system of 5 equations have 5 variables U = (U1,U2,U3,U4,U5). I have a triangular mesh and on each face, I have a face local coordinate system (xl - parallel to the face,yl - perpendicular to face), which is different from the global coordinate system (X,Y). The angle between the face and the global (X,Y) is $\theta$ in anti-clockwise direction. cos()
I want to calculate the components of the 5 variables in the face local coordinate system if the above variable U is in the global coordinate system.
My colleague came up with the following components as:
| U1p | $((cos(\theta))^2*U1) + ((sin(\theta))^2*U2) + (2*cos(\theta)*sin(\theta)*U3)$ |
|---|---|
| U2p | $(((sin(\theta))^2*U1) + ((cos(\theta))^2*U2) - (2*cos(\theta)*sin(\theta)*U3)$ |
| U3p | $(-cos(\theta)*sin(\theta)*U1) + (cos(\theta)*sin(\theta)*U2) + ((cos(\theta)^2 - sin(\theta)^2)*U3)$ |
| U4p | $(U4*cos(\theta)) + (U5*sin(\theta))$ |
| U5p | $(-U4*sin(\theta)) + (U5*cos(\theta))$ |
I am trying hard to derive this but I am unable to understand. Can someone please explain me how did the global components (U1, U2, U3, U4, U5) get converted to the face local coordinate system (U1p, U2p, U3p, U4p, U5p)?
Thank you