Beispiel #1
0
 public void Test_UVNorms()
 {
     // Check that GetUNorm and GetVNorm compute right-handed normals for
     // an edge in the increasing U or V direction.
     for (int face = 0; face < 6; ++face)
     {
         for (double x = -1; x <= 1; x += 1 / 1024.0)
         {
             Assert2.DoubleEqual(S2.FaceUVtoXYZ(face, x, -1)
                                 .CrossProd(S2.FaceUVtoXYZ(face, x, 1))
                                 .Angle(S2.GetUNorm(face, x)), 0);
             Assert2.DoubleEqual(S2.FaceUVtoXYZ(face, -1, x)
                                 .CrossProd(S2.FaceUVtoXYZ(face, 1, x))
                                 .Angle(S2.GetVNorm(face, x)), 0);
         }
     }
 }