-
Notifications
You must be signed in to change notification settings - Fork 0
/
Test__Vector_Interpolation.cs
81 lines (66 loc) · 3.19 KB
/
Test__Vector_Interpolation.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
namespace TEST;
internal static partial class Program {
static void Test__Vector_Interpolation() {
PRINT("\n\n[Utility.VEC -- Interpolation]\n");
//PRINT($"{}");
//======================================================================================================================================================
RESULT("Mix()", true
&& Mix(0.0f, 1.7f, 3.4f).IsApproximately(1.7f)
&& Mix(0.5f, 1.7f, 3.4f).IsApproximately(2.55f)
&& Mix(1.0f, 1.7f, 3.4f).IsApproximately(3.4f)
//@@ more...
);
RESULT("BiMix()", true
&& BiMix((0.0f, 0.0f), 0, 1, 2, 3).IsApproximately(0)
&& BiMix((1.0f, 0.0f), 0, 1, 2, 3).IsApproximately(1)
&& BiMix((0.0f, 1.0f), 0, 1, 2, 3).IsApproximately(2)
&& BiMix((1.0f, 1.0f), 0, 1, 2, 3).IsApproximately(3)
&& BiMix((0.25f, 0.25f), 0, 1, 2, 3).IsApproximately(0.75f)
&& BiMix((0.50f, 0.25f), 0, 1, 2, 3).IsApproximately(1.00f)
&& BiMix((0.75f, 0.25f), 0, 1, 2, 3).IsApproximately(1.25f)
&& BiMix((0.25f, 0.50f), 0, 1, 2, 3).IsApproximately(1.25f)
&& BiMix((0.50f, 0.50f), 0, 1, 2, 3).IsApproximately(1.50f)
&& BiMix((0.75f, 0.50f), 0, 1, 2, 3).IsApproximately(1.75f)
&& BiMix((0.25f, 0.75f), 0, 1, 2, 3).IsApproximately(1.75f)
&& BiMix((0.50f, 0.75f), 0, 1, 2, 3).IsApproximately(2.00f)
&& BiMix((0.75f, 0.75f), 0, 1, 2, 3).IsApproximately(2.25f)
//@@ more...
);
RESULT("SmoothMix()", true
&& SmoothMix(0.0f, 1.7f, 3.4f).IsApproximately(1.7f)
&& SmoothMix(0.5f, 1.7f, 3.4f).IsApproximately(2.55f)
&& SmoothMix(1.0f, 1.7f, 3.4f).IsApproximately(3.4f)
//@@ more...
);
//======================================================================================================================================================
RESULT("Step()", true
&& Step(-2.00f, -1) == 0
&& Step(-1.50f, -1) == 0
&& Step(-1.01f, -1) == 0
&& Step(-1.00f, -1) == 1
&& Step(-0.99f, -1) == 1
&& Step(-0.50f, -1) == 1
&& Step( 0.00f, -1) == 1
&& Step(0.00f, 1) == 0
&& Step(0.50f, 1) == 0
&& Step(0.99f, 1) == 0
&& Step(1.00f, 1) == 1
&& Step(1.01f, 1) == 1
&& Step(1.50f, 1) == 1
&& Step(2.00f, 1) == 1
);
RESULT("LinearStep()", true
&& LinearStep(1.70f, 1.7f, 3.4f).IsApproximately(0.0f)
&& LinearStep(2.55f, 1.7f, 3.4f).IsApproximately(0.5f)
&& LinearStep(3.40f, 1.7f, 3.4f).IsApproximately(1.0f)
//@@ more...
);
RESULT("SmoothStep()", true
&& SmoothStep(1.70f, 1.7f, 3.4f).IsApproximately(0.0f)
&& SmoothStep(2.55f, 1.7f, 3.4f).IsApproximately(0.5f)
&& SmoothStep(3.40f, 1.7f, 3.4f).IsApproximately(1.0f)
//@@ more...
);
//======================================================================================================================================================
}
}