annotate tests/test_vector.nim @ 489:54a1f8ee208e

big refactoring, part1
author Sam <sam@basx.dev>
date Sat, 14 Jan 2023 14:08:00 +0700
parents f226c99b5043
children 547f3a374271
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
474
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
1 import random
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
2 import math
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
3
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
4 import vector
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
5
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
6
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
7 proc echoInfo(v: Vec) =
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
8 echo v
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
9 echo " Length: ", v.length
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
10 echo " Normlized: ", v.normalized
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
11 echo " negated: ", -v
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
12
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
13 proc echoAdd[T, U](v1: T, v2: U) =
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
14 echo v1, " + ", v2, " = ", v1 + v2
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
15 proc echoSub[T, U](v1: T, v2: U) =
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
16 echo v1, " - ", v2, " = ", v1 - v2
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
17 proc echoMul[T, U](v1: T, v2: U) =
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
18 echo v1, " * ", v2, " = ", v1 * v2
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
19 proc echoDiv[T, U](v1: T, v2: U) =
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
20 echo v1, " / ", v2, " = ", v1 / v2
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
21 proc echoDot[T, U](v1: T, v2: U) =
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
22 echo v1, " o ", v2, " = ", v1.dot(v2)
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
23 proc echoCross[T, U](v1: T, v2: U) =
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
24 echo v1, " x ", v2, " = ", v1.cross(v2)
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
25
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
26 proc randVec2I(): auto = newVec2(rand(1 .. 10), rand(1 .. 10))
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
27 proc randVec2F(): auto = newVec2(rand(10'f) + 0.01, rand(10'f) + 0.01)
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
28 proc randVec3I(): auto = newVec3(rand(1 .. 10), rand(1 .. 10), rand(1 .. 10))
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
29 proc randVec3F(): auto = newVec3(rand(10'f) + 0.01, rand(10'f) + 0.01, rand(10'f) + 0.01)
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
30 proc randVec4I(): auto = newVec4(rand(1 .. 10), rand(1 .. 10), rand(1 .. 10), rand(1 .. 10))
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
31 proc randVec4F(): auto = newVec4(rand(10'f) + 0.01, rand(10'f) + 0.01, rand(10'f) + 0.01, rand(10'f) + 0.01)
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
32
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
33
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
34 proc testVector() =
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
35 echoInfo(randVec2I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
36 echoInfo(randVec2F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
37 echoInfo(randVec3I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
38 echoInfo(randVec3F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
39 echoInfo(randVec4I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
40 echoInfo(randVec4F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
41
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
42 # test math operations vector-vector
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
43 echoAdd(randVec2I(), randVec2I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
44 echoAdd(randVec2F(), randVec2F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
45 echoAdd(randVec3I(), randVec3I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
46 echoAdd(randVec3F(), randVec3F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
47 echoAdd(randVec4I(), randVec4I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
48 echoAdd(randVec4F(), randVec4F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
49 echoSub(randVec2I(), randVec2I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
50 echoSub(randVec2F(), randVec2F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
51 echoSub(randVec3I(), randVec3I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
52 echoSub(randVec3F(), randVec3F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
53 echoSub(randVec4I(), randVec4I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
54 echoSub(randVec4F(), randVec4F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
55 echoMul(randVec2I(), randVec2I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
56 echoMul(randVec2F(), randVec2F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
57 echoMul(randVec3I(), randVec3I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
58 echoMul(randVec3F(), randVec3F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
59 echoMul(randVec4I(), randVec4I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
60 echoMul(randVec4F(), randVec4F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
61 echoDiv(randVec2I(), randVec2I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
62 echoDiv(randVec2F(), randVec2F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
63 echoDiv(randVec3I(), randVec3I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
64 echoDiv(randVec3F(), randVec3F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
65 echoDiv(randVec4I(), randVec4I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
66 echoDiv(randVec4F(), randVec4F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
67 echoDot(randVec2I(), randVec2I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
68 echoDot(randVec2F(), randVec2F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
69 echoDot(randVec3I(), randVec3I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
70 echoDot(randVec3F(), randVec3F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
71 echoDot(randVec4I(), randVec4I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
72 echoDot(randVec4F(), randVec4F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
73 echoCross(randVec3I(), randVec3I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
74 echoCross(randVec3F(), randVec3F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
75
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
76
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
77 # test math operations vector-scalar
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
78 echoAdd(randVec2I(), rand(1 .. 10))
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
79 echoAdd(randVec2F(), rand(10'f))
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
80 echoAdd(randVec3I(), rand(1 .. 10))
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
81 echoAdd(randVec3F(), rand(10'f))
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
82 echoAdd(randVec4I(), rand(1 .. 10))
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
83 echoAdd(randVec4F(), rand(10'f))
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
84 echoSub(randVec2I(), rand(1 .. 10))
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
85 echoSub(randVec2F(), rand(10'f))
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
86 echoSub(randVec3I(), rand(1 .. 10))
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
87 echoSub(randVec3F(), rand(10'f))
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
88 echoSub(randVec4I(), rand(1 .. 10))
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
89 echoSub(randVec4F(), rand(10'f))
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
90 echoMul(randVec2I(), rand(1 .. 10))
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
91 echoMul(randVec2F(), rand(10'f))
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
92 echoMul(randVec3I(), rand(1 .. 10))
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
93 echoMul(randVec3F(), rand(10'f))
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
94 echoMul(randVec4I(), rand(1 .. 10))
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
95 echoMul(randVec4F(), rand(10'f))
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
96 echoDiv(randVec2I(), rand(1 .. 10))
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
97 echoDiv(randVec2F(), rand(10'f))
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
98 echoDiv(randVec3I(), rand(1 .. 10))
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
99 echoDiv(randVec3F(), rand(10'f))
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
100 echoDiv(randVec4I(), rand(1 .. 10))
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
101 echoDiv(randVec4F(), rand(10'f))
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
102
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
103 # test math operations scalar-vector
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
104 echoAdd(rand(1 .. 10), randVec2I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
105 echoAdd(rand(10'f), randVec2F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
106 echoAdd(rand(1 .. 10), randVec3I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
107 echoAdd(rand(10'f), randVec3F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
108 echoAdd(rand(1 .. 10), randVec4I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
109 echoAdd(rand(10'f), randVec4F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
110 echoSub(rand(1 .. 10), randVec2I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
111 echoSub(rand(10'f), randVec2F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
112 echoSub(rand(1 .. 10), randVec3I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
113 echoSub(rand(10'f), randVec3F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
114 echoSub(rand(1 .. 10), randVec4I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
115 echoSub(rand(10'f), randVec4F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
116 echoMul(rand(1 .. 10), randVec2I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
117 echoMul(rand(10'f), randVec2F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
118 echoMul(rand(1 .. 10), randVec3I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
119 echoMul(rand(10'f), randVec3F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
120 echoMul(rand(1 .. 10), randVec4I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
121 echoMul(rand(10'f), randVec4F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
122 echoDiv(rand(1 .. 10), randVec2I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
123 echoDiv(rand(10'f), randVec2F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
124 echoDiv(rand(1 .. 10), randVec3I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
125 echoDiv(rand(10'f), randVec3F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
126 echoDiv(rand(1 .. 10), randVec4I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
127 echoDiv(rand(10'f), randVec4F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
128
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
129 # test attribute syntax sugar
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
130 echo "float2int ", to[int](randVec2F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
131 echo "int2float ", to[float](randVec2I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
132 echo "float2int ", to[int](randVec3F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
133 echo "int2float ", to[float](randVec3I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
134 echo "float2int ", to[int](randVec3F())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
135 echo "int2float ", to[float](randVec3I())
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
136
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
137 echo "V2I.xx: ", randVec2I().xx
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
138 echo "V2I.yx: ", randVec2I().xy
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
139 echo "V2F.xx: ", randVec2F().xx
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
140 echo "V2F.yx: ", randVec2F().yx
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
141 echo "V2I.rr: ", randVec2I().rr
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
142 echo "V2I.gr: ", randVec2I().gr
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
143 echo "V2F.rr: ", randVec2F().rr
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
144 echo "V2F.gr: ", randVec2F().gr
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
145
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
146 echo "V3I.yyy: ", randVec3I().yyy
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
147 echo "V3I.yxz: ", randVec3I().xyz
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
148 echo "V3F.yyy: ", randVec3F().yyy
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
149 echo "V3F.yxz: ", randVec3F().yxz
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
150 echo "V3I.ggg: ", randVec3I().ggg
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
151 echo "V3I.grb: ", randVec3I().grb
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
152 echo "V3F.ggg: ", randVec3F().ggg
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
153 echo "V3F.grb: ", randVec3F().grb
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
154
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
155 echo "V4I.zzzz: ", randVec4I().zzzz
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
156 echo "V4I.yxzw: ", randVec4I().xyzw
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
157 echo "V4F.zzzz: ", randVec4F().zzzz
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
158 echo "V4F.yxzw: ", randVec4F().yxzw
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
159 echo "V4I.bbbb: ", randVec4I().bbbb
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
160 echo "V4I.grba: ", randVec4I().grba
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
161 echo "V4F.bbbb: ", randVec4F().bbbb
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
162 echo "V4F.grba: ", randVec4F().grba
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
163
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
164 echo "X: ", X
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
165 echo "Y: ", Y
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
166 echo "Z: ", Z
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
167 echo "X: ", Xi
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
168 echo "Y: ", Yi
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
169 echo "Z: ", Zi
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
170
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
171
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
172 randomize()
d4750f2e0760 add: vector/matrix modules, tests, nim config script
Sam <sam@basx.dev>
parents:
diff changeset
173 testVector()