vectorMagnitude: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "<dt class="note">'''\[\[.*\]\]'''" to "<dt class="note">$1") |
Lou Montana (talk | contribs) m (Fix username deletion mistake) |
||
Line 11: | Line 11: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| | | [[vectorMagnitude]] vector |SYNTAX= | ||
|p1= vector: [[Array]] |PARAMETER1= | |p1= vector: [[Array]] |PARAMETER1= | ||
Line 18: | Line 18: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
|x1= <code>_size = [[vectorMagnitude]] [0,3,4]; | |x1= <code>_size = [[vectorMagnitude]] [0,3,4]; {{cc|returns 5}}</code> |EXAMPLE1= | ||
|x2= <code>_speed = [[vectorMagnitude]] [[velocity]] [[player]]; | |x2= <code>_speed = [[vectorMagnitude]] [[velocity]] [[player]]; {{cc|return velocity of player in m/s}} | ||
_speed = ([[vectorMagnitude]] [[velocity]] [[player]]) * 3.6; | _speed = ([[vectorMagnitude]] [[velocity]] [[player]]) * 3.6; {{cc|return velocity of player in km/h}} | ||
_speed = ([[vectorMagnitude]] [[velocity]] [[player]]) * 2.23694; | _speed = ([[vectorMagnitude]] [[velocity]] [[player]]) * 2.23694; {{cc|return velocity of player in mph}}</code> |EXAMPLE2= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| [[vectorAdd]], [[vectorDiff]], [[vectorCrossProduct]], [[vectorDotProduct]], [[vectorCos]], [[vectorMagnitudeSqr]], [[vectorMultiply]], [[vectorDistance]], [[vectorDistanceSqr]], [[vectorDir]], [[vectorUp]], [[setVectorDir]], [[setVectorUp]], [[setVectorDirAndUp]], [[vectorNormalized]], [[vectorFromTo]], [[matrixMultiply]], [[matrixTranspose]] |SEEALSO= | | [[vectorAdd]], [[vectorDiff]], [[vectorCrossProduct]], [[vectorDotProduct]], [[vectorCos]], [[vectorMagnitudeSqr]], [[vectorMultiply]], [[vectorDistance]], [[vectorDistanceSqr]], [[vectorDir]], [[vectorUp]], [[setVectorDir]], [[setVectorUp]], [[setVectorDirAndUp]], [[vectorNormalized]], [[vectorFromTo]], [[matrixMultiply]], [[matrixTranspose]] |SEEALSO= | ||
}} | }} | ||
Line 33: | Line 32: | ||
<!-- Note Section BEGIN --> | <!-- Note Section BEGIN --> | ||
<dd class="notedate">Posted on 28 Jun, 2014 | <dd class="notedate">Posted on 28 Jun, 2014 | ||
<dt class="note">[[]]<dd class="note"> | <dt class="note">[[User:ffur2007slx2_5| ffur2007slx2_5]] | ||
(ArmA3 1.22)Algorithm: | <dd class="note"> | ||
<code> | (ArmA3 1.22) Algorithm: | ||
Vector = [x,y,z]; | <code>Vector = [x,y,z]; | ||
Result = [[sqrt]] ((x ^ 2) + (y ^ 2) + (z ^ 2)) | Result = [[sqrt]] ((x ^ 2) + (y ^ 2) + (z ^ 2)); | ||
</code> | </code> | ||
It is recommended to use [[vectorMagnitude]] instead of [[BIS_fnc_magnitude]]. | It is recommended to use [[vectorMagnitude]] instead of [[BIS_fnc_magnitude]]. | ||
Line 44: | Line 43: | ||
<h3 style="display:none">Bottom Section</h3> | <h3 style="display:none">Bottom Section</h3> | ||
Revision as of 18:55, 19 May 2020
Description
- Description:
- Magnitude of a 3D vector.
- Groups:
- Uncategorised
Syntax
- Syntax:
- vectorMagnitude vector
- Parameters:
- vector: Array
- Return Value:
- Number
Examples
- Example 1:
_size = vectorMagnitude [0,3,4]; // returns 5
- Example 2:
_speed = vectorMagnitude velocity player; // return velocity of player in m/s _speed = (vectorMagnitude velocity player) * 3.6; // return velocity of player in km/h _speed = (vectorMagnitude velocity player) * 2.23694; // return velocity of player in mph
Additional Information
- See also:
- vectorAddvectorDiffvectorCrossProductvectorDotProductvectorCosvectorMagnitudeSqrvectorMultiplyvectorDistancevectorDistanceSqrvectorDirvectorUpsetVectorDirsetVectorUpsetVectorDirAndUpvectorNormalizedvectorFromTomatrixMultiplymatrixTranspose
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Notes
- Posted on 28 Jun, 2014
- ffur2007slx2_5
-
(ArmA3 1.22) Algorithm:
Vector = [x,y,z]; Result = sqrt ((x ^ 2) + (y ^ 2) + (z ^ 2));
It is recommended to use vectorMagnitude instead of BIS_fnc_magnitude.