包含平移和旋转变换:
#include <iostream>
#include <GTEngine/Mathematics/GteConvertCoordinates.h>
using namespace gte;
// #define Vector4<double> Vector<4, double>
int main(int argc, char const *argv[])
{
// // Affine change of basis.
ConvertCoordinates<4, double> convert;
Vector<4, double> X, Y, P0, P1, diff;
Matrix<4, 4, double> U, V, A, B;
bool isRHU, isRHV;
V.SetCol(0, Vector<4, double>{1.0, 0.0, 0.0, 0.0});
V.SetCol(1, Vector<4, double>{0.0, 1.0, 0.0, 0.0});
V.SetCol(2, Vector<4, double>{0.0, 0.0, 1.0, 0.0});
V.SetCol(3, Vector<4, double>{0.0, 0.0, 0.0, 1.0});
U.SetCol(0, Vector<4, double>{0.866, 0.5, 0.0, 0.0});
U.SetCol(1, Vector<4, double>{-0.5, 0.866, 0.0, 0.0});
U.SetCol(2, Vector<4, double>{0, 0, 1.0, 0.0});
U.SetCol(3, Vector<4, double>{10.0, 5.0, 0.0, 1.0});
convert(U, true, V, false);
isRHU = convert.IsRightHandedU(); // false
i