@@ -41,40 +41,40 @@ defmodule Scenic.Math.Matrix do
41
41
@ matrix_size 4 * 16
42
42
43
43
@ matrix_zero <<
44
- 0.0 :: float - size ( 32 ) - native ,
45
- 0.0 :: float - size ( 32 ) - native ,
46
- 0.0 :: float - size ( 32 ) - native ,
47
- 0.0 :: float - size ( 32 ) - native ,
48
- 0.0 :: float - size ( 32 ) - native ,
49
- 0.0 :: float - size ( 32 ) - native ,
50
- 0.0 :: float - size ( 32 ) - native ,
51
- 0.0 :: float - size ( 32 ) - native ,
52
- 0.0 :: float - size ( 32 ) - native ,
53
- 0.0 :: float - size ( 32 ) - native ,
54
- 0.0 :: float - size ( 32 ) - native ,
55
- 0.0 :: float - size ( 32 ) - native ,
56
- 0.0 :: float - size ( 32 ) - native ,
57
- 0.0 :: float - size ( 32 ) - native ,
58
- 0.0 :: float - size ( 32 ) - native ,
59
- 0.0 :: float - size ( 32 ) - native
44
+ + 0.0 :: float - size ( 32 ) - native ,
45
+ + 0.0 :: float - size ( 32 ) - native ,
46
+ + 0.0 :: float - size ( 32 ) - native ,
47
+ + 0.0 :: float - size ( 32 ) - native ,
48
+ + 0.0 :: float - size ( 32 ) - native ,
49
+ + 0.0 :: float - size ( 32 ) - native ,
50
+ + 0.0 :: float - size ( 32 ) - native ,
51
+ + 0.0 :: float - size ( 32 ) - native ,
52
+ + 0.0 :: float - size ( 32 ) - native ,
53
+ + 0.0 :: float - size ( 32 ) - native ,
54
+ + 0.0 :: float - size ( 32 ) - native ,
55
+ + 0.0 :: float - size ( 32 ) - native ,
56
+ + 0.0 :: float - size ( 32 ) - native ,
57
+ + 0.0 :: float - size ( 32 ) - native ,
58
+ + 0.0 :: float - size ( 32 ) - native ,
59
+ + 0.0 :: float - size ( 32 ) - native
60
60
>>
61
61
62
62
@ matrix_identity <<
63
63
1.0 :: float - size ( 32 ) - native ,
64
- 0.0 :: float - size ( 32 ) - native ,
65
- 0.0 :: float - size ( 32 ) - native ,
66
- 0.0 :: float - size ( 32 ) - native ,
67
- 0.0 :: float - size ( 32 ) - native ,
64
+ + 0.0 :: float - size ( 32 ) - native ,
65
+ + 0.0 :: float - size ( 32 ) - native ,
66
+ + 0.0 :: float - size ( 32 ) - native ,
67
+ + 0.0 :: float - size ( 32 ) - native ,
68
68
1.0 :: float - size ( 32 ) - native ,
69
- 0.0 :: float - size ( 32 ) - native ,
70
- 0.0 :: float - size ( 32 ) - native ,
71
- 0.0 :: float - size ( 32 ) - native ,
72
- 0.0 :: float - size ( 32 ) - native ,
69
+ + 0.0 :: float - size ( 32 ) - native ,
70
+ + 0.0 :: float - size ( 32 ) - native ,
71
+ + 0.0 :: float - size ( 32 ) - native ,
72
+ + 0.0 :: float - size ( 32 ) - native ,
73
73
1.0 :: float - size ( 32 ) - native ,
74
- 0.0 :: float - size ( 32 ) - native ,
75
- 0.0 :: float - size ( 32 ) - native ,
76
- 0.0 :: float - size ( 32 ) - native ,
77
- 0.0 :: float - size ( 32 ) - native ,
74
+ + 0.0 :: float - size ( 32 ) - native ,
75
+ + 0.0 :: float - size ( 32 ) - native ,
76
+ + 0.0 :: float - size ( 32 ) - native ,
77
+ + 0.0 :: float - size ( 32 ) - native ,
78
78
1.0 :: float - size ( 32 ) - native
79
79
>>
80
80
@@ -116,19 +116,19 @@ defmodule Scenic.Math.Matrix do
116
116
# <<
117
117
# v0x::float-size(32)-native,
118
118
# v0y::float-size(32)-native,
119
- # 0.0::float-size(32)-native,
120
- # 0.0::float-size(32)-native,
119
+ # + 0.0::float-size(32)-native,
120
+ # + 0.0::float-size(32)-native,
121
121
# v1x::float-size(32)-native,
122
122
# v1y::float-size(32)-native,
123
- # 0.0::float-size(32)-native,
124
- # 0.0::float-size(32)-native,
125
- # 0.0::float-size(32)-native,
126
- # 0.0::float-size(32)-native,
123
+ # + 0.0::float-size(32)-native,
124
+ # + 0.0::float-size(32)-native,
125
+ # + 0.0::float-size(32)-native,
126
+ # + 0.0::float-size(32)-native,
127
127
# 1.0::float-size(32)-native,
128
- # 0.0::float-size(32)-native,
129
- # 0.0::float-size(32)-native,
130
- # 0.0::float-size(32)-native,
131
- # 0.0::float-size(32)-native,
128
+ # + 0.0::float-size(32)-native,
129
+ # + 0.0::float-size(32)-native,
130
+ # + 0.0::float-size(32)-native,
131
+ # + 0.0::float-size(32)-native,
132
132
# 1.0::float-size(32)-native
133
133
# >>
134
134
# end
@@ -140,18 +140,18 @@ defmodule Scenic.Math.Matrix do
140
140
# v0x::float-size(32)-native,
141
141
# v0y::float-size(32)-native,
142
142
# v0z::float-size(32)-native,
143
- # 0.0::float-size(32)-native,
143
+ # + 0.0::float-size(32)-native,
144
144
# v1x::float-size(32)-native,
145
145
# v1y::float-size(32)-native,
146
146
# v1z::float-size(32)-native,
147
- # 0.0::float-size(32)-native,
147
+ # + 0.0::float-size(32)-native,
148
148
# v2x::float-size(32)-native,
149
149
# v2y::float-size(32)-native,
150
150
# v2z::float-size(32)-native,
151
- # 0.0::float-size(32)-native,
152
- # 0.0::float-size(32)-native,
153
- # 0.0::float-size(32)-native,
154
- # 0.0::float-size(32)-native,
151
+ # + 0.0::float-size(32)-native,
152
+ # + 0.0::float-size(32)-native,
153
+ # + 0.0::float-size(32)-native,
154
+ # + 0.0::float-size(32)-native,
155
155
# 1.0::float-size(32)-native
156
156
# >>
157
157
# end
@@ -200,26 +200,26 @@ defmodule Scenic.Math.Matrix do
200
200
"""
201
201
@ spec build_translation ( vector_2 :: Math . vector_2 ( ) ) :: Math . matrix ( )
202
202
def build_translation ( vector_2 )
203
- def build_translation ( { x , y } ) , do: do_build_translation ( { x , y , 0.0 } )
203
+ def build_translation ( { x , y } ) , do: do_build_translation ( { x , y , + 0.0 } )
204
204
# def build_translation({x, y, z}), do: build_translation(x, y, z)
205
- # def build_translation(x, y), do: build_translation(x, y, 0.0)
205
+ # def build_translation(x, y), do: build_translation(x, y, + 0.0)
206
206
defp do_build_translation ( { x , y , z } ) do
207
207
<<
208
208
1.0 :: float - size ( 32 ) - native ,
209
- 0.0 :: float - size ( 32 ) - native ,
210
- 0.0 :: float - size ( 32 ) - native ,
209
+ + 0.0 :: float - size ( 32 ) - native ,
210
+ + 0.0 :: float - size ( 32 ) - native ,
211
211
x * 1.0 :: float - size ( 32 ) - native ,
212
- 0.0 :: float - size ( 32 ) - native ,
212
+ + 0.0 :: float - size ( 32 ) - native ,
213
213
1.0 :: float - size ( 32 ) - native ,
214
- 0.0 :: float - size ( 32 ) - native ,
214
+ + 0.0 :: float - size ( 32 ) - native ,
215
215
y * 1.0 :: float - size ( 32 ) - native ,
216
- 0.0 :: float - size ( 32 ) - native ,
217
- 0.0 :: float - size ( 32 ) - native ,
216
+ + 0.0 :: float - size ( 32 ) - native ,
217
+ + 0.0 :: float - size ( 32 ) - native ,
218
218
1.0 :: float - size ( 32 ) - native ,
219
219
z * 1.0 :: float - size ( 32 ) - native ,
220
- 0.0 :: float - size ( 32 ) - native ,
221
- 0.0 :: float - size ( 32 ) - native ,
222
- 0.0 :: float - size ( 32 ) - native ,
220
+ + 0.0 :: float - size ( 32 ) - native ,
221
+ + 0.0 :: float - size ( 32 ) - native ,
222
+ + 0.0 :: float - size ( 32 ) - native ,
223
223
1.0 :: float - size ( 32 ) - native
224
224
>>
225
225
end
@@ -243,20 +243,20 @@ defmodule Scenic.Math.Matrix do
243
243
defp do_build_scale ( { x , y , z } ) do
244
244
<<
245
245
x * 1.0 :: float - size ( 32 ) - native ,
246
- 0.0 :: float - size ( 32 ) - native ,
247
- 0.0 :: float - size ( 32 ) - native ,
248
- 0.0 :: float - size ( 32 ) - native ,
249
- 0.0 :: float - size ( 32 ) - native ,
246
+ + 0.0 :: float - size ( 32 ) - native ,
247
+ + 0.0 :: float - size ( 32 ) - native ,
248
+ + 0.0 :: float - size ( 32 ) - native ,
249
+ + 0.0 :: float - size ( 32 ) - native ,
250
250
y * 1.0 :: float - size ( 32 ) - native ,
251
- 0.0 :: float - size ( 32 ) - native ,
252
- 0.0 :: float - size ( 32 ) - native ,
253
- 0.0 :: float - size ( 32 ) - native ,
254
- 0.0 :: float - size ( 32 ) - native ,
251
+ + 0.0 :: float - size ( 32 ) - native ,
252
+ + 0.0 :: float - size ( 32 ) - native ,
253
+ + 0.0 :: float - size ( 32 ) - native ,
254
+ + 0.0 :: float - size ( 32 ) - native ,
255
255
z * 1.0 :: float - size ( 32 ) - native ,
256
- 0.0 :: float - size ( 32 ) - native ,
257
- 0.0 :: float - size ( 32 ) - native ,
258
- 0.0 :: float - size ( 32 ) - native ,
259
- 0.0 :: float - size ( 32 ) - native ,
256
+ + 0.0 :: float - size ( 32 ) - native ,
257
+ + 0.0 :: float - size ( 32 ) - native ,
258
+ + 0.0 :: float - size ( 32 ) - native ,
259
+ + 0.0 :: float - size ( 32 ) - native ,
260
260
1.0 :: float - size ( 32 ) - native
261
261
>>
262
262
end
@@ -290,23 +290,23 @@ defmodule Scenic.Math.Matrix do
290
290
# sin = :math.sin( radians )
291
291
# <<
292
292
# 1.0 :: float-size(32)-native,
293
- # 0.0 :: float-size(32)-native,
294
- # 0.0 :: float-size(32)-native,
295
- # 0.0 :: float-size(32)-native,
293
+ # + 0.0 :: float-size(32)-native,
294
+ # + 0.0 :: float-size(32)-native,
295
+ # + 0.0 :: float-size(32)-native,
296
296
297
- # 0.0 :: float-size(32)-native,
297
+ # + 0.0 :: float-size(32)-native,
298
298
# cos :: float-size(32)-native,
299
299
# sin :: float-size(32)-native,
300
- # 0.0 :: float-size(32)-native,
300
+ # + 0.0 :: float-size(32)-native,
301
301
302
- # 0.0 :: float-size(32)-native,
302
+ # + 0.0 :: float-size(32)-native,
303
303
# -sin :: float-size(32)-native,
304
304
# cos :: float-size(32)-native,
305
- # 0.0 :: float-size(32)-native,
305
+ # + 0.0 :: float-size(32)-native,
306
306
307
- # 0.0 :: float-size(32)-native,
308
- # 0.0 :: float-size(32)-native,
309
- # 0.0 :: float-size(32)-native,
307
+ # + 0.0 :: float-size(32)-native,
308
+ # + 0.0 :: float-size(32)-native,
309
+ # + 0.0 :: float-size(32)-native,
310
310
# 1.0 :: float-size(32)-native
311
311
# >>
312
312
# end
@@ -316,23 +316,23 @@ defmodule Scenic.Math.Matrix do
316
316
# sin = :math.sin( radians )
317
317
# <<
318
318
# cos :: float-size(32)-native,
319
- # 0.0 :: float-size(32)-native,
319
+ # + 0.0 :: float-size(32)-native,
320
320
# sin :: float-size(32)-native,
321
- # 0.0 :: float-size(32)-native,
321
+ # + 0.0 :: float-size(32)-native,
322
322
323
- # 0.0 :: float-size(32)-native,
323
+ # + 0.0 :: float-size(32)-native,
324
324
# 1.0 :: float-size(32)-native,
325
- # 0.0 :: float-size(32)-native,
326
- # 0.0 :: float-size(32)-native,
325
+ # + 0.0 :: float-size(32)-native,
326
+ # + 0.0 :: float-size(32)-native,
327
327
328
328
# -sin :: float-size(32)-native,
329
- # 0.0 :: float-size(32)-native,
329
+ # + 0.0 :: float-size(32)-native,
330
330
# cos :: float-size(32)-native,
331
- # 0.0 :: float-size(32)-native,
331
+ # + 0.0 :: float-size(32)-native,
332
332
333
- # 0.0 :: float-size(32)-native,
334
- # 0.0 :: float-size(32)-native,
335
- # 0.0 :: float-size(32)-native,
333
+ # + 0.0 :: float-size(32)-native,
334
+ # + 0.0 :: float-size(32)-native,
335
+ # + 0.0 :: float-size(32)-native,
336
336
# 1.0 :: float-size(32)-native
337
337
# >>
338
338
# end
@@ -344,19 +344,19 @@ defmodule Scenic.Math.Matrix do
344
344
<<
345
345
cos :: float - size ( 32 ) - native ,
346
346
- sin :: float - size ( 32 ) - native ,
347
- 0.0 :: float - size ( 32 ) - native ,
348
- 0.0 :: float - size ( 32 ) - native ,
347
+ + 0.0 :: float - size ( 32 ) - native ,
348
+ + 0.0 :: float - size ( 32 ) - native ,
349
349
sin :: float - size ( 32 ) - native ,
350
350
cos :: float - size ( 32 ) - native ,
351
- 0.0 :: float - size ( 32 ) - native ,
352
- 0.0 :: float - size ( 32 ) - native ,
353
- 0.0 :: float - size ( 32 ) - native ,
354
- 0.0 :: float - size ( 32 ) - native ,
351
+ + 0.0 :: float - size ( 32 ) - native ,
352
+ + 0.0 :: float - size ( 32 ) - native ,
353
+ + 0.0 :: float - size ( 32 ) - native ,
354
+ + 0.0 :: float - size ( 32 ) - native ,
355
355
1.0 :: float - size ( 32 ) - native ,
356
- 0.0 :: float - size ( 32 ) - native ,
357
- 0.0 :: float - size ( 32 ) - native ,
358
- 0.0 :: float - size ( 32 ) - native ,
359
- 0.0 :: float - size ( 32 ) - native ,
356
+ + 0.0 :: float - size ( 32 ) - native ,
357
+ + 0.0 :: float - size ( 32 ) - native ,
358
+ + 0.0 :: float - size ( 32 ) - native ,
359
+ + 0.0 :: float - size ( 32 ) - native ,
360
360
1.0 :: float - size ( 32 ) - native
361
361
>>
362
362
end
@@ -579,14 +579,14 @@ defmodule Scenic.Math.Matrix do
579
579
Parameters:
580
580
* matrix_a: The first matrix
581
581
* matrix_b: The second matrix
582
- * tolerance: Defines what close means. Defaults to: 0.000001
582
+ * tolerance: Defines what close means. Defaults to: + 0.000001
583
583
584
584
Returns:
585
585
A boolean
586
586
"""
587
587
@ spec close? ( matrix_a :: Math . matrix ( ) , matrix_a :: Math . matrix ( ) , tolerance :: number ) ::
588
588
boolean
589
- def close? ( matrix_a , matrix_b , tolerance \\ 0.000001 )
589
+ def close? ( matrix_a , matrix_b , tolerance \\ + 0.000001 )
590
590
591
591
def close? ( << _ :: binary - size ( @ matrix_size ) >> = a , << _ :: binary - size ( @ matrix_size ) >> = b , t )
592
592
when is_float ( t ) do
@@ -790,7 +790,7 @@ defmodule Scenic.Math.Matrix do
790
790
@ spec invert ( matrix :: Math . matrix ( ) ) :: Math . matrix ( )
791
791
def invert ( matrix ) do
792
792
case nif_determinant ( matrix ) do
793
- 0.0 ->
793
+ + 0.0 ->
794
794
:err_zero_determinant
795
795
796
796
det ->
0 commit comments