MCPcopy Create free account
hub / github.com/StereoKit/StereoKit / TestAngleDist

Method TestAngleDist

Examples/StereoKitTest/Tests/TestMath.cs:74–94  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

72 }
73
74 bool TestAngleDist()
75 {
76 float angleDistA = SKMath.AngleDist(0, 359);
77 float angleDistB = SKMath.AngleDist(359, 0);
78 float angleDistC = SKMath.AngleDist(359, 720);
79 float angleDistD = SKMath.AngleDist(-60, 70);
80 float angleDistE = SKMath.AngleDist(-60, 140);
81
82 Log.Info($"AngleDist 0 to 359: {angleDistA}");
83 Log.Info($"AngleDist 359 to 0: {angleDistB}");
84 Log.Info($"AngleDist 359 to 720: {angleDistC}");
85 Log.Info($"AngleDist -60 to 70: {angleDistD}");
86 Log.Info($"AngleDist -60 to 140: {angleDistE}");
87
88 if (MathF.Abs(angleDistA - angleDistB) > tolerance) return false;
89 if (MathF.Abs(angleDistA - angleDistC) > tolerance) return false;
90 if (MathF.Abs(angleDistA - 1) > tolerance) return false;
91 if (MathF.Abs(angleDistD - 130) > tolerance) return false;
92 if (MathF.Abs(angleDistE - 160) > tolerance) return false;
93 return true;
94 }
95
96 bool TestVector2Angles()
97 {

Callers

nothing calls this directly

Calls 2

AngleDistMethod · 0.80
InfoMethod · 0.80

Tested by

no test coverage detected