-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add basic functions for change of basis in 3D #939
Conversation
for "_j" from 0 to (_n - 1) do | ||
{ | ||
private _returnRow = []; | ||
for "_i" from 0 to (_m - 1) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use apply
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, the same goes for CBA_fnc_matrixProduct3D
.
Made some ocd style fixes. |
@@ -12,13 +12,28 @@ private _fnc_vectorEquals = { | |||
if ((count _vector1) != (count _vector2)) exitWith {false}; | |||
private _equal = true; | |||
{ | |||
if ((abs (_x - (_vector2 select _forEachIndex))) > 0.00001) then { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be replaced by findIf I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
findif
does not support _forEachIndex
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to, findIf is kind of hard to read.
execVM "\x\cba\addons\vectors\test_vectors.sqf" 9:31:27 [CBA] (vectors) LOG: Testing Vectors x\cba\addons\vectors\test_vectors.sqf:39
9:31:27 [CBA] (vectors) Test OK: (CBA_fnc_polar2vect is defined) x\cba\addons\vectors\test_vectors.sqf:43
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:47
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:51
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:55
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:59
9:31:27 [CBA] (vectors) Test OK: (CBA_fnc_scaleVect is defined) x\cba\addons\vectors\test_vectors.sqf:64
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:68
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:72
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:76
9:31:27 [CBA] (vectors) Test OK: (CBA_fnc_scaleVectTo is defined) x\cba\addons\vectors\test_vectors.sqf:81
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:85
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:89
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:93
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:97
9:31:27 [CBA] (vectors) Test OK: (CBA_fnc_simplifyAngle is defined) x\cba\addons\vectors\test_vectors.sqf:102
9:31:27 [CBA] (vectors) Test OK: (_result == _expected) CBA_fnc_simplifyAngle x\cba\addons\vectors\test_vectors.sqf:106
9:31:27 [CBA] (vectors) Test OK: (_result == _expected) CBA_fnc_simplifyAngle x\cba\addons\vectors\test_vectors.sqf:110
9:31:27 [CBA] (vectors) Test OK: (_result == _expected) CBA_fnc_simplifyAngle x\cba\addons\vectors\test_vectors.sqf:114
9:31:27 [CBA] (vectors) Test OK: (CBA_fnc_simplifyAngle180 is defined) x\cba\addons\vectors\test_vectors.sqf:119
9:31:27 [CBA] (vectors) Test OK: (_result == _expected) CBA_fnc_simplifyAngle180 x\cba\addons\vectors\test_vectors.sqf:123
9:31:27 [CBA] (vectors) Test OK: (_result == _expected) CBA_fnc_simplifyAngle180 x\cba\addons\vectors\test_vectors.sqf:127
9:31:27 [CBA] (vectors) Test OK: (_result == _expected) CBA_fnc_simplifyAngle180 x\cba\addons\vectors\test_vectors.sqf:131
9:31:27 [CBA] (vectors) Test OK: (CBA_fnc_vect2Polar is defined) x\cba\addons\vectors\test_vectors.sqf:136
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:140
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:144
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:148
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:152
9:31:27 [CBA] (vectors) Test OK: (CBA_fnc_vectAdd is defined) x\cba\addons\vectors\test_vectors.sqf:158
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:162
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:166
9:31:27 [CBA] (vectors) Test OK: (CBA_fnc_vectCross is defined) x\cba\addons\vectors\test_vectors.sqf:172
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:176
9:31:27 [CBA] (vectors) Test OK: (CBA_fnc_vectCross2D is defined) x\cba\addons\vectors\test_vectors.sqf:181
9:31:27 [CBA] (vectors) Test OK: (_result == _expected) CBA_fnc_vectCross2D x\cba\addons\vectors\test_vectors.sqf:185
9:31:27 [CBA] (vectors) Test OK: (CBA_fnc_vectDir is defined) x\cba\addons\vectors\test_vectors.sqf:190
9:31:27 [CBA] (vectors) Test OK: (_result == _expected) CBA_fnc_vectDir x\cba\addons\vectors\test_vectors.sqf:194
9:31:27 [CBA] (vectors) Test OK: (_result == _expected) CBA_fnc_vectDir x\cba\addons\vectors\test_vectors.sqf:198
9:31:27 [CBA] (vectors) Test OK: (CBA_fnc_vectDot is defined) x\cba\addons\vectors\test_vectors.sqf:203
9:31:27 [CBA] (vectors) Test OK: (_result == _expected) CBA_fnc_vectDot x\cba\addons\vectors\test_vectors.sqf:207
9:31:27 [CBA] (vectors) Test OK: (_result == _expected) CBA_fnc_vectDot x\cba\addons\vectors\test_vectors.sqf:211
9:31:27 [CBA] (vectors) Test OK: (CBA_fnc_vectElev is defined) x\cba\addons\vectors\test_vectors.sqf:216
9:31:27 [CBA] (vectors) Test OK: (_result == _expected) CBA_fnc_vectElev x\cba\addons\vectors\test_vectors.sqf:220
9:31:27 [CBA] (vectors) Test OK: (_result == _expected) CBA_fnc_vectElev x\cba\addons\vectors\test_vectors.sqf:224
9:31:27 [CBA] (vectors) Test OK: (CBA_fnc_vectMagn is defined) x\cba\addons\vectors\test_vectors.sqf:229
9:31:27 [CBA] (vectors) Test OK: (_result == _expected) CBA_fnc_vectMagn x\cba\addons\vectors\test_vectors.sqf:233
9:31:27 [CBA] (vectors) Test OK: (_result == _expected) CBA_fnc_vectMagn x\cba\addons\vectors\test_vectors.sqf:237
9:31:27 [CBA] (vectors) Test OK: (CBA_fnc_vectMagn2D is defined) x\cba\addons\vectors\test_vectors.sqf:242
9:31:27 [CBA] (vectors) Test OK: (_result == _expected) CBA_fnc_vectMagn2D x\cba\addons\vectors\test_vectors.sqf:246
9:31:27 [CBA] (vectors) Test OK: (_result == _expected) CBA_fnc_vectMagn2D x\cba\addons\vectors\test_vectors.sqf:250
9:31:27 [CBA] (vectors) Test OK: (CBA_fnc_vectRotate2D is defined) x\cba\addons\vectors\test_vectors.sqf:255
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:259
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:263
9:31:27 [CBA] (vectors) Test OK: (CBA_fnc_vectRotate3D is defined) x\cba\addons\vectors\test_vectors.sqf:267
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:271
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:275
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:279
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:283
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:287
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:291
9:31:27 [CBA] (vectors) Test OK: (CBA_fnc_vectSubtract is defined) x\cba\addons\vectors\test_vectors.sqf:295
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:299
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:306
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:311
9:31:27 [CBA] (vectors) Test OK: (CBA_fnc_vectMap3D is defined) x\cba\addons\vectors\test_vectors.sqf:316
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:320
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_vectorEquals) x\cba\addons\vectors\test_vectors.sqf:324
9:31:27 [CBA] (vectors) Test OK: (CBA_fnc_matrixTranspose is defined) x\cba\addons\vectors\test_vectors.sqf:328
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_matrixEquals) x\cba\addons\vectors\test_vectors.sqf:332
9:31:27 [CBA] (vectors) Test OK: (CBA_fnc_matrixProduct3D is defined) x\cba\addons\vectors\test_vectors.sqf:336
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_matrixEquals) x\cba\addons\vectors\test_vectors.sqf:340
9:31:27 [CBA] (vectors) Test OK: ([_result, _expected] call _fnc_matrixEquals) x\cba\addons\vectors\test_vectors.sqf:346 |
When merged this pull request will:
CBA_fnc_matrixProduct3D
for the product of two 3x3-matrices.CBA_fnc_matrixTranspose
for transposing a mxn-matrix.CBA_fnc_vectMap3D
for 3x3-matrix - 3D-vector multiplication.