mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-03-22 21:01:50 +08:00
Documentation for 9438ea11a2
This commit is contained in:
@@ -145,7 +145,7 @@ Functions</h2></td></tr>
|
||||
</div><!-- fragment --><p>The direction ratios (DR) are calculated as follows: 1st DR, J: (b * z) - (c * y) 2nd DR, A: -((a * z) - (c * x)) 3rd DR, N: (a * y) - (b * x)</p>
|
||||
<p>Therefore, the direction ratios of the cross product are: J, A, N The following C++ Program calculates the direction ratios of the cross products of two vector. The program uses a function, <a class="el" href="../../df/d66/vector__cross__product_8cpp.html#abed307975124243d63fe2e118254defe" title="Function to calculate the cross product of the passed arrays containing the direction ratios of the t...">cross()</a> for doing so. The direction ratios for the first and the second vector has to be passed one by one seperated by a space character.</p>
|
||||
<p>Magnitude of a vector is the square root of the sum of the squares of the direction ratios.</p>
|
||||
<h3><a class="anchor" id="autotoc_md65"></a>
|
||||
<h3><a class="anchor" id="autotoc_md66"></a>
|
||||
Example:</h3>
|
||||
<p>An example of a running instance of the executable program: </p><pre class="fragment">Pass the first Vector: 1 2 3
|
||||
</pre><p> Pass the second Vector: 4 5 6 The cross product is: -3 6 -3 Magnitude: 7.34847</p>
|
||||
|
||||
Reference in New Issue
Block a user