@@ -41,40 +41,40 @@ defmodule Scenic.Math.Matrix do
4141 @ matrix_size 4 * 16
4242
4343 @ 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
6060 >>
6161
6262 @ matrix_identity <<
6363 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 ,
6868 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 ,
7373 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 ,
7878 1.0 :: float - size ( 32 ) - native
7979 >>
8080
@@ -116,19 +116,19 @@ defmodule Scenic.Math.Matrix do
116116 # <<
117117 # v0x::float-size(32)-native,
118118 # 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,
121121 # v1x::float-size(32)-native,
122122 # 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,
127127 # 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,
132132 # 1.0::float-size(32)-native
133133 # >>
134134 # end
@@ -140,18 +140,18 @@ defmodule Scenic.Math.Matrix do
140140 # v0x::float-size(32)-native,
141141 # v0y::float-size(32)-native,
142142 # v0z::float-size(32)-native,
143- # 0.0::float-size(32)-native,
143+ # + 0.0::float-size(32)-native,
144144 # v1x::float-size(32)-native,
145145 # v1y::float-size(32)-native,
146146 # v1z::float-size(32)-native,
147- # 0.0::float-size(32)-native,
147+ # + 0.0::float-size(32)-native,
148148 # v2x::float-size(32)-native,
149149 # v2y::float-size(32)-native,
150150 # 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,
155155 # 1.0::float-size(32)-native
156156 # >>
157157 # end
@@ -200,26 +200,26 @@ defmodule Scenic.Math.Matrix do
200200 """
201201 @ spec build_translation ( vector_2 :: Math . vector_2 ( ) ) :: Math . matrix ( )
202202 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 } )
204204 # 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)
206206 defp do_build_translation ( { x , y , z } ) do
207207 <<
208208 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 ,
211211 x * 1.0 :: float - size ( 32 ) - native ,
212- 0.0 :: float - size ( 32 ) - native ,
212+ + 0.0 :: float - size ( 32 ) - native ,
213213 1.0 :: float - size ( 32 ) - native ,
214- 0.0 :: float - size ( 32 ) - native ,
214+ + 0.0 :: float - size ( 32 ) - native ,
215215 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 ,
218218 1.0 :: float - size ( 32 ) - native ,
219219 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 ,
223223 1.0 :: float - size ( 32 ) - native
224224 >>
225225 end
@@ -243,20 +243,20 @@ defmodule Scenic.Math.Matrix do
243243 defp do_build_scale ( { x , y , z } ) do
244244 <<
245245 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 ,
250250 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 ,
255255 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 ,
260260 1.0 :: float - size ( 32 ) - native
261261 >>
262262 end
@@ -290,23 +290,23 @@ defmodule Scenic.Math.Matrix do
290290 # sin = :math.sin( radians )
291291 # <<
292292 # 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,
296296
297- # 0.0 :: float-size(32)-native,
297+ # + 0.0 :: float-size(32)-native,
298298 # cos :: float-size(32)-native,
299299 # sin :: float-size(32)-native,
300- # 0.0 :: float-size(32)-native,
300+ # + 0.0 :: float-size(32)-native,
301301
302- # 0.0 :: float-size(32)-native,
302+ # + 0.0 :: float-size(32)-native,
303303 # -sin :: float-size(32)-native,
304304 # cos :: float-size(32)-native,
305- # 0.0 :: float-size(32)-native,
305+ # + 0.0 :: float-size(32)-native,
306306
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,
310310 # 1.0 :: float-size(32)-native
311311 # >>
312312 # end
@@ -316,23 +316,23 @@ defmodule Scenic.Math.Matrix do
316316 # sin = :math.sin( radians )
317317 # <<
318318 # cos :: float-size(32)-native,
319- # 0.0 :: float-size(32)-native,
319+ # + 0.0 :: float-size(32)-native,
320320 # sin :: float-size(32)-native,
321- # 0.0 :: float-size(32)-native,
321+ # + 0.0 :: float-size(32)-native,
322322
323- # 0.0 :: float-size(32)-native,
323+ # + 0.0 :: float-size(32)-native,
324324 # 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,
327327
328328 # -sin :: float-size(32)-native,
329- # 0.0 :: float-size(32)-native,
329+ # + 0.0 :: float-size(32)-native,
330330 # cos :: float-size(32)-native,
331- # 0.0 :: float-size(32)-native,
331+ # + 0.0 :: float-size(32)-native,
332332
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,
336336 # 1.0 :: float-size(32)-native
337337 # >>
338338 # end
@@ -344,19 +344,19 @@ defmodule Scenic.Math.Matrix do
344344 <<
345345 cos :: float - size ( 32 ) - native ,
346346 - 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 ,
349349 sin :: float - size ( 32 ) - native ,
350350 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 ,
355355 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 ,
360360 1.0 :: float - size ( 32 ) - native
361361 >>
362362 end
@@ -579,14 +579,14 @@ defmodule Scenic.Math.Matrix do
579579 Parameters:
580580 * matrix_a: The first matrix
581581 * 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
583583
584584 Returns:
585585 A boolean
586586 """
587587 @ spec close? ( matrix_a :: Math . matrix ( ) , matrix_a :: Math . matrix ( ) , tolerance :: number ) ::
588588 boolean
589- def close? ( matrix_a , matrix_b , tolerance \\ 0.000001 )
589+ def close? ( matrix_a , matrix_b , tolerance \\ + 0.000001 )
590590
591591 def close? ( << _ :: binary - size ( @ matrix_size ) >> = a , << _ :: binary - size ( @ matrix_size ) >> = b , t )
592592 when is_float ( t ) do
@@ -790,7 +790,7 @@ defmodule Scenic.Math.Matrix do
790790 @ spec invert ( matrix :: Math . matrix ( ) ) :: Math . matrix ( )
791791 def invert ( matrix ) do
792792 case nif_determinant ( matrix ) do
793- 0.0 ->
793+ + 0.0 ->
794794 :err_zero_determinant
795795
796796 det ->
0 commit comments