For CQUAD4 Nastran elements, the origin of the element coordinate system is defined to be the intersection of straight lines AC and BD( A, B, C, and D being the corners of the element). As long as the four defining nodes are co-planar, this definition is sufficient. But otherwise, the two straight lines do not intersection, and a generalization of the definition of the origin has to be found. We decide that the origin of the coordinate system shall be the point closest to the two straight lines AC and BD.
The two straight lines can be defined with corresponding parameterized equations:
So, one has to find the parameters and that minimize . The vector can be developed as follows:
where
The square of the norm defined above depends on parameters and and is given by:
This function must be stationary at the optimum point. Therefore its first derivatives wrt and must be zero:
This leads to a system of two linear equations with the two unknowns and :
These two equations may be rewritten as follows:
Or simply
This equation simply means that the vector connecting the two optimum points is perpendicular to both lines AC and BD. Finally, after resolution of the system of equations and various substitutions, on finds the origin of coordinate system at: