Documentation for 8b1eab204b

This commit is contained in:
realstealthninja
2024-11-04 12:43:05 +00:00
parent 4fb6e622e9
commit a7bccf7d01
6732 changed files with 153919 additions and 365711 deletions

View File

@@ -1,3 +1,4 @@
<!-- HTML header for doxygen 1.12.0-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
@@ -5,10 +6,15 @@
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: math/vector_cross_product.cpp File Reference</title>
<title>TheAlgorithms/C++: math/vector_cross_product.cpp File Reference</title>
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@xpack-3rd-party/doxygen-awesome-css@2.2.0-1/doxygen-awesome-darkmode-toggle.js"></script>
<script type="text/javascript">
DoxygenAwesomeDarkModeToggle.init()
</script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../navtreedata.js"></script>
@@ -18,14 +24,24 @@
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
<script type="text/javascript">
window.MathJax = {
options: {
ignoreHtmlClass: 'tex2jax_ignore',
processHtmlClass: 'tex2jax_process'
},
loader: {
load: ['[tex]/ams']
},
tex: {
macros: {},
packages: ['base','configmacros','ams']
}
};
</script>
<script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML/MathJax.js"></script>
<script type="text/javascript" id="MathJax-script" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
<link href="../../doxygen-awesome.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
@@ -33,10 +49,11 @@ MathJax.Hub.Config({
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="../../project_logo.png"/></td>
<td id="projectalign">
<div id="projectname">Algorithms_in_C++<span id="projectnumber">&#160;1.0.0</span>
<div id="projectname">TheAlgorithms/C++<span id="projectnumber">&#160;1.0.0</span>
</div>
<div id="projectbrief">Set of algorithms implemented in C++.</div>
<div id="projectbrief">All the algorithms implemented in C++</div>
</td>
</tr>
</tbody>
@@ -122,7 +139,9 @@ Include dependency graph for vector_cross_product.cpp:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../db/dc3/vector__cross__product_8cpp__incl.svg" width="327" height="111"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div><table class="memberdecls">
</div>
<p><a href="../../df/d66/vector__cross__product_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="namespaces" name="namespaces"></a>
Namespaces</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d47/namespacemath.html">math</a></td></tr>
@@ -134,10 +153,10 @@ Namespaces</h2></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a225732399c5c076976eae5b180a9f8c9" id="r_a225732399c5c076976eae5b180a9f8c9"><td class="memItemLeft" align="right" valign="top"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; double, 3 &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a225732399c5c076976eae5b180a9f8c9">math::vector_cross::cross</a> (const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; double, 3 &gt; &amp;A, const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; double, 3 &gt; &amp;B)</td></tr>
<tr class="memitem:a225732399c5c076976eae5b180a9f8c9" id="r_a225732399c5c076976eae5b180a9f8c9"><td class="memItemLeft" align="right" valign="top">std::array&lt; double, 3 &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a225732399c5c076976eae5b180a9f8c9">math::vector_cross::cross</a> (const std::array&lt; double, 3 &gt; &amp;A, const std::array&lt; double, 3 &gt; &amp;B)</td></tr>
<tr class="memdesc:a225732399c5c076976eae5b180a9f8c9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function to calculate the cross product of the passed arrays containing the direction ratios of the two mathematical vectors. <br /></td></tr>
<tr class="separator:a225732399c5c076976eae5b180a9f8c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4b2a9757a87c18e1642d72410ecfaba8" id="r_a4b2a9757a87c18e1642d72410ecfaba8"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a4b2a9757a87c18e1642d72410ecfaba8">math::vector_cross::mag</a> (const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; double, 3 &gt; &amp;vec)</td></tr>
<tr class="memitem:a4b2a9757a87c18e1642d72410ecfaba8" id="r_a4b2a9757a87c18e1642d72410ecfaba8"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a4b2a9757a87c18e1642d72410ecfaba8">math::vector_cross::mag</a> (const std::array&lt; double, 3 &gt; &amp;vec)</td></tr>
<tr class="memdesc:a4b2a9757a87c18e1642d72410ecfaba8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculates the magnitude of the mathematical vector from it's direction ratios. <br /></td></tr>
<tr class="separator:a4b2a9757a87c18e1642d72410ecfaba8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8dca7b867074164d5f45b0f3851269d" id="r_aa8dca7b867074164d5f45b0f3851269d"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aa8dca7b867074164d5f45b0f3851269d">test</a> ()</td></tr>
@@ -162,6 +181,8 @@ Example:</h3>
<p>An example of a running instance of the executable program:</p>
<p>Pass the first Vector: 1 2 3 Pass the second Vector: 4 5 6 The cross product is: -3 6 -3 Magnitude: 7.34847</p>
<dl class="section author"><dt>Author</dt><dd><a href="https://github.com/Shreyas-OwO" target="_blank">Shreyas Sable</a> </dd></dl>
<p class="definition">Definition in file <a class="el" href="../../df/d66/vector__cross__product_8cpp_source.html">vector_cross_product.cpp</a>.</p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="a225732399c5c076976eae5b180a9f8c9" name="a225732399c5c076976eae5b180a9f8c9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a225732399c5c076976eae5b180a9f8c9">&#9670;&#160;</a></span>cross()</h2>
@@ -170,14 +191,14 @@ Example:</h3>
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; double, 3 &gt; math::vector_cross::cross </td>
<td class="memname">std::array&lt; double, 3 &gt; math::vector_cross::cross </td>
<td>(</td>
<td class="paramtype">const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; double, 3 &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>A</em></span>, </td>
<td class="paramtype">const std::array&lt; double, 3 &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>A</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; double, 3 &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>B</em></span>&#160;)</td>
<td class="paramtype">const std::array&lt; double, 3 &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>B</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
@@ -192,21 +213,16 @@ Example:</h3>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the direction ratios of the cross product. </dd></dl>
<p>Performs the cross product as shown in @algorithm.</p>
<p class="definition">Definition at line <a class="el" href="../../df/d66/vector__cross__product_8cpp_source.html#l00069">69</a> of file <a class="el" href="../../df/d66/vector__cross__product_8cpp_source.html">vector_cross_product.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 69</span> {</div>
<div class="line"><span class="lineno"> 70</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array&lt;double, 3&gt;</a> product;<span class="comment"></span></div>
<div class="line"><span class="lineno"> 71</span><span class="comment"> /// Performs the cross product as shown in @algorithm.</span></div>
<div class="line"><span class="lineno"> 72</span><span class="comment"></span> product[0] = (A[1] * B[2]) - (A[2] * B[1]);</div>
<div class="line"><span class="lineno"> 70</span> std::array&lt;double, 3&gt; product;</div>
<div class="line"><span class="lineno"> 72</span> product[0] = (A[1] * B[2]) - (A[2] * B[1]);</div>
<div class="line"><span class="lineno"> 73</span> product[1] = -((A[0] * B[2]) - (A[2] * B[0]));</div>
<div class="line"><span class="lineno"> 74</span> product[2] = (A[0] * B[1]) - (A[1] * B[0]);</div>
<div class="line"><span class="lineno"> 75</span> <span class="keywordflow">return</span> product;</div>
<div class="line"><span class="lineno"> 76</span> }</div>
<div class="ttc" id="aarray_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a></div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d66/vector__cross__product_8cpp_a225732399c5c076976eae5b180a9f8c9_cgraph.svg" width="144" height="76"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div><!-- fragment -->
</div>
</div>
<a id="a4b2a9757a87c18e1642d72410ecfaba8" name="a4b2a9757a87c18e1642d72410ecfaba8"></a>
@@ -218,7 +234,7 @@ Here is the call graph for this function:</div>
<tr>
<td class="memname">double math::vector_cross::mag </td>
<td>(</td>
<td class="paramtype">const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a>&lt; double, 3 &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>vec</em></span></td><td>)</td>
<td class="paramtype">const std::array&lt; double, 3 &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>vec</em></span></td><td>)</td>
<td></td>
</tr>
</table>
@@ -232,17 +248,13 @@ Here is the call graph for this function:</div>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>type: double description: the magnitude of the mathematical vector from the given direction ratios. </dd></dl>
<p class="definition">Definition at line <a class="el" href="../../df/d66/vector__cross__product_8cpp_source.html#l00083">83</a> of file <a class="el" href="../../df/d66/vector__cross__product_8cpp_source.html">vector_cross_product.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 83</span> {</div>
<div class="line"><span class="lineno"> 84</span> <span class="keywordtype">double</span> magnitude = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html">sqrt</a>((vec[0] * vec[0]) + (vec[1] * vec[1]) + (vec[2] * vec[2]));</div>
<div class="line"><span class="lineno"> 84</span> <span class="keywordtype">double</span> magnitude = sqrt((vec[0] * vec[0]) + (vec[1] * vec[1]) + (vec[2] * vec[2]));</div>
<div class="line"><span class="lineno"> 85</span> <span class="keywordflow">return</span> magnitude;</div>
<div class="line"><span class="lineno"> 86</span> }</div>
<div class="ttc" id="asqrt_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html">std::sqrt</a></div><div class="ttdeci">T sqrt(T... args)</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d66/vector__cross__product_8cpp_a4b2a9757a87c18e1642d72410ecfaba8_cgraph.svg" width="178" height="60"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div><!-- fragment -->
</div>
</div>
<a id="ae66f6b31b5ad750f1fe042a706a4e3d4" name="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
@@ -261,49 +273,38 @@ Here is the call graph for this function:</div>
</div><div class="memdoc">
<p>Main Function. </p>
<p>Asks the user to enter the direction ratios for each of the two mathematical vectors using <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> </p><dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
<p>Asks the user to enter the direction ratios for each of the two mathematical vectors using std::cin </p><dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
<p>Tests the functions with sample input before asking for user input.</p>
<p>Gets the values for the first vector.</p>
<p>Gets the values for the second vector.</p>
<p>Displays the output out.</p>
<p>Displays the magnitude of the cross product.</p>
<p class="definition">Definition at line <a class="el" href="../../df/d66/vector__cross__product_8cpp_source.html#l00109">109</a> of file <a class="el" href="../../df/d66/vector__cross__product_8cpp_source.html">vector_cross_product.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 109</span> {</div>
<div class="line"><span class="lineno"> 110</span><span class="comment"></span> </div>
<div class="line"><span class="lineno"> 111</span><span class="comment"> /// Tests the functions with sample input before asking for user input.</span></div>
<div class="line"><span class="lineno"> 112</span><span class="comment"></span> <a class="code hl_function" href="#aa8dca7b867074164d5f45b0f3851269d">test</a>();</div>
<div class="line"><span class="lineno"> 110</span> </div>
<div class="line"><span class="lineno"> 112</span> <a class="code hl_function" href="#aa8dca7b867074164d5f45b0f3851269d">test</a>();</div>
<div class="line"><span class="lineno"> 113</span> </div>
<div class="line"><span class="lineno"> 114</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array&lt;double, 3&gt;</a> vec1;</div>
<div class="line"><span class="lineno"> 115</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array&lt;double, 3&gt;</a> vec2;</div>
<div class="line"><span class="lineno"> 116</span><span class="comment"></span> </div>
<div class="line"><span class="lineno"> 117</span><span class="comment"> /// Gets the values for the first vector.</span></div>
<div class="line"><span class="lineno"> 118</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;\nPass the first Vector: &quot;</span>;</div>
<div class="line"><span class="lineno"> 119</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> &gt;&gt; vec1[0] &gt;&gt; vec1[1] &gt;&gt; vec1[2];</div>
<div class="line"><span class="lineno"> 120</span><span class="comment"></span> </div>
<div class="line"><span class="lineno"> 121</span><span class="comment"> /// Gets the values for the second vector.</span></div>
<div class="line"><span class="lineno"> 122</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;\nPass the second Vector: &quot;</span>;</div>
<div class="line"><span class="lineno"> 123</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> &gt;&gt; vec2[0] &gt;&gt; vec2[1] &gt;&gt; vec2[2];</div>
<div class="line"><span class="lineno"> 124</span><span class="comment"></span> </div>
<div class="line"><span class="lineno"> 125</span><span class="comment"> /// Displays the output out.</span></div>
<div class="line"><span class="lineno"> 126</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array&lt;double, 3&gt;</a> product = <a class="code hl_function" href="#a225732399c5c076976eae5b180a9f8c9">math::vector_cross::cross</a>(vec1, vec2);</div>
<div class="line"><span class="lineno"> 127</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;\nThe cross product is: &quot;</span> &lt;&lt; product[0] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; product[1] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; product[2] &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 128</span><span class="comment"></span> </div>
<div class="line"><span class="lineno"> 129</span><span class="comment"> /// Displays the magnitude of the cross product.</span></div>
<div class="line"><span class="lineno"> 130</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;Magnitude: &quot;</span> &lt;&lt; <a class="code hl_function" href="#a4b2a9757a87c18e1642d72410ecfaba8">math::vector_cross::mag</a>(product) &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span> &lt;&lt; <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
<div class="line"><span class="lineno"> 114</span> std::array&lt;double, 3&gt; vec1;</div>
<div class="line"><span class="lineno"> 115</span> std::array&lt;double, 3&gt; vec2;</div>
<div class="line"><span class="lineno"> 116</span> </div>
<div class="line"><span class="lineno"> 118</span> std::cout &lt;&lt; <span class="stringliteral">&quot;\nPass the first Vector: &quot;</span>;</div>
<div class="line"><span class="lineno"> 119</span> std::cin &gt;&gt; vec1[0] &gt;&gt; vec1[1] &gt;&gt; vec1[2];</div>
<div class="line"><span class="lineno"> 120</span> </div>
<div class="line"><span class="lineno"> 122</span> std::cout &lt;&lt; <span class="stringliteral">&quot;\nPass the second Vector: &quot;</span>;</div>
<div class="line"><span class="lineno"> 123</span> std::cin &gt;&gt; vec2[0] &gt;&gt; vec2[1] &gt;&gt; vec2[2];</div>
<div class="line"><span class="lineno"> 124</span> </div>
<div class="line"><span class="lineno"> 126</span> std::array&lt;double, 3&gt; product = <a class="code hl_function" href="#a225732399c5c076976eae5b180a9f8c9">math::vector_cross::cross</a>(vec1, vec2);</div>
<div class="line"><span class="lineno"> 127</span> std::cout &lt;&lt; <span class="stringliteral">&quot;\nThe cross product is: &quot;</span> &lt;&lt; product[0] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; product[1] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; product[2] &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 128</span> </div>
<div class="line"><span class="lineno"> 130</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Magnitude: &quot;</span> &lt;&lt; <a class="code hl_function" href="#a4b2a9757a87c18e1642d72410ecfaba8">math::vector_cross::mag</a>(product) &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 131</span> </div>
<div class="line"><span class="lineno"> 132</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><span class="lineno"> 133</span>}</div>
<div class="ttc" id="abasic_istream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a></div></div>
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
<div class="ttc" id="aendl_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a></div><div class="ttdeci">T endl(T... args)</div></div>
<div class="ttc" id="avector__cross__product_8cpp_html_a225732399c5c076976eae5b180a9f8c9"><div class="ttname"><a href="#a225732399c5c076976eae5b180a9f8c9">math::vector_cross::cross</a></div><div class="ttdeci">std::array&lt; double, 3 &gt; cross(const std::array&lt; double, 3 &gt; &amp;A, const std::array&lt; double, 3 &gt; &amp;B)</div><div class="ttdoc">Function to calculate the cross product of the passed arrays containing the direction ratios of the t...</div><div class="ttdef"><b>Definition</b> vector_cross_product.cpp:69</div></div>
<div class="ttc" id="avector__cross__product_8cpp_html_a4b2a9757a87c18e1642d72410ecfaba8"><div class="ttname"><a href="#a4b2a9757a87c18e1642d72410ecfaba8">math::vector_cross::mag</a></div><div class="ttdeci">double mag(const std::array&lt; double, 3 &gt; &amp;vec)</div><div class="ttdoc">Calculates the magnitude of the mathematical vector from it's direction ratios.</div><div class="ttdef"><b>Definition</b> vector_cross_product.cpp:83</div></div>
<div class="ttc" id="avector__cross__product_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">namespace math</div><div class="ttdef"><b>Definition</b> vector_cross_product.cpp:94</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d66/vector__cross__product_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="180" height="86"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
<div class="ttc" id="avector__cross__product_8cpp_html_a225732399c5c076976eae5b180a9f8c9"><div class="ttname"><a href="#a225732399c5c076976eae5b180a9f8c9">math::vector_cross::cross</a></div><div class="ttdeci">std::array&lt; double, 3 &gt; cross(const std::array&lt; double, 3 &gt; &amp;A, const std::array&lt; double, 3 &gt; &amp;B)</div><div class="ttdoc">Function to calculate the cross product of the passed arrays containing the direction ratios of the t...</div><div class="ttdef"><b>Definition</b> <a href="../../df/d66/vector__cross__product_8cpp_source.html#l00069">vector_cross_product.cpp:69</a></div></div>
<div class="ttc" id="avector__cross__product_8cpp_html_a4b2a9757a87c18e1642d72410ecfaba8"><div class="ttname"><a href="#a4b2a9757a87c18e1642d72410ecfaba8">math::vector_cross::mag</a></div><div class="ttdeci">double mag(const std::array&lt; double, 3 &gt; &amp;vec)</div><div class="ttdoc">Calculates the magnitude of the mathematical vector from it's direction ratios.</div><div class="ttdef"><b>Definition</b> <a href="../../df/d66/vector__cross__product_8cpp_source.html#l00083">vector_cross_product.cpp:83</a></div></div>
<div class="ttc" id="avector__cross__product_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">namespace math</div><div class="ttdef"><b>Definition</b> <a href="../../df/d66/vector__cross__product_8cpp_source.html#l00094">vector_cross_product.cpp:94</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a id="aa8dca7b867074164d5f45b0f3851269d" name="aa8dca7b867074164d5f45b0f3851269d"></a>
@@ -334,13 +335,13 @@ Here is the call graph for this function:</div>
<p>test the cross() and the mag() functions. </p>
<p>Tests the cross() function.</p>
<p>Tests the mag() function.</p>
<div class="fragment"><div class="line"><span class="lineno"> 94</span> {<span class="comment"></span></div>
<div class="line"><span class="lineno"> 95</span><span class="comment"> /// Tests the cross() function.</span></div>
<div class="line"><span class="lineno"> 96</span><span class="comment"></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/array.html">std::array&lt;double, 3&gt;</a> t_vec = <a class="code hl_function" href="#a225732399c5c076976eae5b180a9f8c9">math::vector_cross::cross</a>({1, 2, 3}, {4, 5, 6});</div>
<p class="definition">Definition at line <a class="el" href="../../df/d66/vector__cross__product_8cpp_source.html#l00094">94</a> of file <a class="el" href="../../df/d66/vector__cross__product_8cpp_source.html">vector_cross_product.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 94</span> {</div>
<div class="line"><span class="lineno"> 96</span> std::array&lt;double, 3&gt; t_vec = <a class="code hl_function" href="#a225732399c5c076976eae5b180a9f8c9">math::vector_cross::cross</a>({1, 2, 3}, {4, 5, 6});</div>
<div class="line"><span class="lineno"> 97</span> assert(t_vec[0] == -3 &amp;&amp; t_vec[1] == 6 &amp;&amp; t_vec[2] == -3);</div>
<div class="line"><span class="lineno"> 98</span><span class="comment"></span> </div>
<div class="line"><span class="lineno"> 99</span><span class="comment"> /// Tests the mag() function.</span></div>
<div class="line"><span class="lineno"> 100</span><span class="comment"></span> <span class="keywordtype">double</span> t_mag = <a class="code hl_function" href="#a4b2a9757a87c18e1642d72410ecfaba8">math::vector_cross::mag</a>({6, 8, 0});</div>
<div class="line"><span class="lineno"> 98</span> </div>
<div class="line"><span class="lineno"> 100</span> <span class="keywordtype">double</span> t_mag = <a class="code hl_function" href="#a4b2a9757a87c18e1642d72410ecfaba8">math::vector_cross::mag</a>({6, 8, 0});</div>
<div class="line"><span class="lineno"> 101</span> assert(t_mag == 10);</div>
<div class="line"><span class="lineno"> 102</span>}</div>
</div><!-- fragment -->

View File

@@ -1,4 +0,0 @@
<map id="math::vector_cross::cross" name="math::vector_cross::cross">
<area shape="rect" id="Node000001" title="Function to calculate the cross product of the passed arrays containing the direction ratios of the t..." alt="" coords="5,29,139,70"/>
<area shape="poly" id="edge1_Node000001_Node000001" title=" " alt="" coords="46,29,45,20,49,11,58,5,72,3,87,5,96,12,93,16,85,10,72,8,60,10,53,14,50,20,51,28"/>
</map>

View File

@@ -1 +0,0 @@
fbc9c89b82d64d40b1245384749c8a57

View File

@@ -1,57 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: math::vector_cross::cross Pages: 1 -->
<svg width="108pt" height="57pt"
viewBox="0.00 0.00 108.00 56.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
<style type="text/css"><![CDATA[
.node, .edge {opacity: 0.7;}
.node.selected, .edge.selected {opacity: 1;}
.edge:hover path { stroke: red; }
.edge:hover polygon { stroke: red; fill: red; }
]]></style>
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
<svg id="graph" class="graph">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 52.5)">
<title>math::vector_cross::cross</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="Function to calculate the cross product of the passed arrays containing the direction ratios of the t...">
<polygon fill="#999999" stroke="#666666" points="100,-30.5 0,-30.5 0,0 100,0 100,-30.5"/>
<text text-anchor="start" x="8" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">math::vector_cross</text>
<text text-anchor="middle" x="50" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">::cross</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node1 -->
<g id="edge1_Node000001_Node000001" class="edge">
<title>Node1&#45;&gt;Node1</title>
<g id="a_edge1_Node000001_Node000001"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M32.28,-30.99C28.66,-40.06 34.57,-48.5 50,-48.5 58.44,-48.5 64.03,-45.97 66.77,-42.2"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="70.24,-42.75 67.59,-32.49 63.26,-42.16 70.24,-42.75"/>
</a>
</g>
</g>
</g>
</svg>
</svg>
<style type='text/css'>
<![CDATA[
[data-mouse-over-selected='false'] { opacity: 0.7; }
[data-mouse-over-selected='true'] { opacity: 1.0; }
]]>
</style>
<script type="application/ecmascript"><![CDATA[
document.addEventListener('DOMContentLoaded', (event) => {
highlightEdges();
highlightAdjacentNodes();
});
]]></script>
</svg>

Before

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -1,31 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: math::vector_cross::cross Pages: 1 -->
<svg width="108pt" height="57pt"
viewBox="0.00 0.00 108.00 56.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 52.5)">
<title>math::vector_cross::cross</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="Function to calculate the cross product of the passed arrays containing the direction ratios of the t...">
<polygon fill="#999999" stroke="#666666" points="100,-30.5 0,-30.5 0,0 100,0 100,-30.5"/>
<text text-anchor="start" x="8" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">math::vector_cross</text>
<text text-anchor="middle" x="50" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">::cross</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node1 -->
<g id="edge1_Node000001_Node000001" class="edge">
<title>Node1&#45;&gt;Node1</title>
<g id="a_edge1_Node000001_Node000001"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M32.28,-30.99C28.66,-40.06 34.57,-48.5 50,-48.5 58.44,-48.5 64.03,-45.97 66.77,-42.2"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="70.24,-42.75 67.59,-32.49 63.26,-42.16 70.24,-42.75"/>
</a>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -1,4 +0,0 @@
<map id="math::vector_cross::mag" name="math::vector_cross::mag">
<area shape="rect" id="Node000001" title="Calculates the magnitude of the mathematical vector from it&#39;s direction ratios." alt="" coords="5,29,172,55"/>
<area shape="poly" id="edge1_Node000001_Node000001" title=" " alt="" coords="60,30,55,21,58,11,70,5,89,3,109,5,119,12,117,16,107,10,88,8,71,10,62,15,60,20,65,28"/>
</map>

View File

@@ -1 +0,0 @@
ab3c29ea72945fcd6f2da7ac6ec5e811

View File

@@ -1,56 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: math::vector_cross::mag Pages: 1 -->
<svg width="133pt" height="45pt"
viewBox="0.00 0.00 132.75 45.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
<style type="text/css"><![CDATA[
.node, .edge {opacity: 0.7;}
.node.selected, .edge.selected {opacity: 1;}
.edge:hover path { stroke: red; }
.edge:hover polygon { stroke: red; fill: red; }
]]></style>
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
<svg id="graph" class="graph">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 41.25)">
<title>math::vector_cross::mag</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="Calculates the magnitude of the mathematical vector from it&#39;s direction ratios.">
<polygon fill="#999999" stroke="#666666" points="124.75,-19.25 0,-19.25 0,0 124.75,0 124.75,-19.25"/>
<text text-anchor="middle" x="62.38" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">math::vector_cross::mag</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node1 -->
<g id="edge1_Node000001_Node000001" class="edge">
<title>Node1&#45;&gt;Node1</title>
<g id="a_edge1_Node000001_Node000001"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M42.84,-19.54C33.94,-28.15 40.45,-37.25 62.38,-37.25 74.37,-37.25 81.75,-34.53 84.52,-30.65"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="87.95,-29.95 82.25,-21.01 81.13,-31.55 87.95,-29.95"/>
</a>
</g>
</g>
</g>
</svg>
</svg>
<style type='text/css'>
<![CDATA[
[data-mouse-over-selected='false'] { opacity: 0.7; }
[data-mouse-over-selected='true'] { opacity: 1.0; }
]]>
</style>
<script type="application/ecmascript"><![CDATA[
document.addEventListener('DOMContentLoaded', (event) => {
highlightEdges();
highlightAdjacentNodes();
});
]]></script>
</svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -1,30 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: math::vector_cross::mag Pages: 1 -->
<svg width="133pt" height="45pt"
viewBox="0.00 0.00 132.75 45.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 41.25)">
<title>math::vector_cross::mag</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="Calculates the magnitude of the mathematical vector from it&#39;s direction ratios.">
<polygon fill="#999999" stroke="#666666" points="124.75,-19.25 0,-19.25 0,0 124.75,0 124.75,-19.25"/>
<text text-anchor="middle" x="62.38" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">math::vector_cross::mag</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node1 -->
<g id="edge1_Node000001_Node000001" class="edge">
<title>Node1&#45;&gt;Node1</title>
<g id="a_edge1_Node000001_Node000001"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M42.84,-19.54C33.94,-28.15 40.45,-37.25 62.38,-37.25 74.37,-37.25 81.75,-34.53 84.52,-30.65"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="87.95,-29.95 82.25,-21.01 81.13,-31.55 87.95,-29.95"/>
</a>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -1,7 +0,0 @@
<map id="main" name="main">
<area shape="rect" id="Node000001" title="Main Function." alt="" coords="5,31,55,56"/>
<area shape="rect" id="Node000002" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="103,5,174,31"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="55,35,87,27,88,33,56,40"/>
<area shape="rect" id="Node000003" href="$df/d66/vector__cross__product_8cpp.html#aa8dca7b867074164d5f45b0f3851269d" title="namespace math" alt="" coords="117,55,160,80"/>
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="56,46,102,57,101,62,55,52"/>
</map>

View File

@@ -1 +0,0 @@
99b196c3a8a9d36b647c3ba154635fc5

View File

@@ -1,83 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: main Pages: 1 -->
<svg width="135pt" height="64pt"
viewBox="0.00 0.00 134.50 64.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
<style type="text/css"><![CDATA[
.node, .edge {opacity: 0.7;}
.node.selected, .edge.selected {opacity: 1;}
.edge:hover path { stroke: red; }
.edge:hover polygon { stroke: red; fill: red; }
]]></style>
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
<svg id="graph" class="graph">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 60.25)">
<title>main</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="Main Function.">
<polygon fill="#999999" stroke="#666666" points="37,-37.25 0,-37.25 0,-18 37,-18 37,-37.25"/>
<text text-anchor="middle" x="18.5" y="-23.75" font-family="Helvetica,sans-Serif" font-size="10.00">main</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="126.5,-56.25 73,-56.25 73,-37 126.5,-37 126.5,-56.25"/>
<text text-anchor="middle" x="99.75" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M37.48,-31.94C44.64,-33.65 53.16,-35.69 61.53,-37.7"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="60.71,-41.1 71.25,-40.03 62.34,-34.3 60.71,-41.1"/>
</a>
</g>
</g>
<!-- Node3 -->
<g id="Node000003" class="node">
<title>Node3</title>
<g id="a_Node000003"><a xlink:href="../../df/d66/vector__cross__product_8cpp.html#aa8dca7b867074164d5f45b0f3851269d" target="_top" xlink:title="namespace math">
<polygon fill="white" stroke="#666666" points="116,-19.25 83.5,-19.25 83.5,0 116,0 116,-19.25"/>
<text text-anchor="middle" x="99.75" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">test</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node3 -->
<g id="edge2_Node000001_Node000003" class="edge">
<title>Node1&#45;&gt;Node3</title>
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M37.48,-23.54C47.72,-21.22 60.73,-18.26 72.13,-15.67"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="72.79,-19.11 81.77,-13.48 71.24,-12.28 72.79,-19.11"/>
</a>
</g>
</g>
</g>
</svg>
</svg>
<style type='text/css'>
<![CDATA[
[data-mouse-over-selected='false'] { opacity: 0.7; }
[data-mouse-over-selected='true'] { opacity: 1.0; }
]]>
</style>
<script type="application/ecmascript"><![CDATA[
document.addEventListener('DOMContentLoaded', (event) => {
highlightEdges();
highlightAdjacentNodes();
});
]]></script>
</svg>

Before

Width:  |  Height:  |  Size: 3.2 KiB

View File

@@ -1,57 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
-->
<!-- Title: main Pages: 1 -->
<svg width="135pt" height="64pt"
viewBox="0.00 0.00 134.50 64.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 60.25)">
<title>main</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="Main Function.">
<polygon fill="#999999" stroke="#666666" points="37,-37.25 0,-37.25 0,-18 37,-18 37,-37.25"/>
<text text-anchor="middle" x="18.5" y="-23.75" font-family="Helvetica,sans-Serif" font-size="10.00">main</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="126.5,-56.25 73,-56.25 73,-37 126.5,-37 126.5,-56.25"/>
<text text-anchor="middle" x="99.75" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M37.48,-31.94C44.64,-33.65 53.16,-35.69 61.53,-37.7"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="60.71,-41.1 71.25,-40.03 62.34,-34.3 60.71,-41.1"/>
</a>
</g>
</g>
<!-- Node3 -->
<g id="Node000003" class="node">
<title>Node3</title>
<g id="a_Node000003"><a xlink:href="../../df/d66/vector__cross__product_8cpp.html#aa8dca7b867074164d5f45b0f3851269d" target="_top" xlink:title="namespace math">
<polygon fill="white" stroke="#666666" points="116,-19.25 83.5,-19.25 83.5,0 116,0 116,-19.25"/>
<text text-anchor="middle" x="99.75" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">test</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node3 -->
<g id="edge2_Node000001_Node000003" class="edge">
<title>Node1&#45;&gt;Node3</title>
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M37.48,-23.54C47.72,-21.22 60.73,-18.26 72.13,-15.67"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="72.79,-19.11 81.77,-13.48 71.24,-12.28 72.79,-19.11"/>
</a>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -0,0 +1,202 @@
<!-- HTML header for doxygen 1.12.0-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>TheAlgorithms/C++: math/vector_cross_product.cpp Source File</title>
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@xpack-3rd-party/doxygen-awesome-css@2.2.0-1/doxygen-awesome-darkmode-toggle.js"></script>
<script type="text/javascript">
DoxygenAwesomeDarkModeToggle.init()
</script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
window.MathJax = {
options: {
ignoreHtmlClass: 'tex2jax_ignore',
processHtmlClass: 'tex2jax_process'
},
loader: {
load: ['[tex]/ams']
},
tex: {
macros: {},
packages: ['base','configmacros','ams']
}
};
</script>
<script type="text/javascript" id="MathJax-script" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
<link href="../../doxygen-awesome.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><img alt="Logo" src="../../project_logo.png"/></td>
<td id="projectalign">
<div id="projectname">TheAlgorithms/C++<span id="projectnumber">&#160;1.0.0</span>
</div>
<div id="projectbrief">All the algorithms implemented in C++</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.12.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(1); });
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('../../',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('df/d66/vector__cross__product_8cpp_source.html','../../'); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">vector_cross_product.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../df/d66/vector__cross__product_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span><span class="preprocessor">#include &lt;iostream&gt;</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span><span class="preprocessor">#include &lt;array&gt;</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span><span class="preprocessor">#include &lt;cmath&gt;</span></div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span><span class="preprocessor">#include &lt;cassert&gt;</span></div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> </div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../dd/d47/namespacemath.html">math</a> {</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <span class="keyword">namespace </span><a class="code hl_namespace" href="../../d4/d91/namespacevector__cross.html">vector_cross</a> {</div>
<div class="foldopen" id="foldopen00069" data-start="{" data-end="}">
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"><a class="line" href="../../df/d66/vector__cross__product_8cpp.html#a225732399c5c076976eae5b180a9f8c9"> 69</a></span> std::array&lt;double, 3&gt; <a class="code hl_function" href="../../df/d66/vector__cross__product_8cpp.html#a225732399c5c076976eae5b180a9f8c9">cross</a>(<span class="keyword">const</span> std::array&lt;double, 3&gt; &amp;A, <span class="keyword">const</span> std::array&lt;double, 3&gt; &amp;B) {</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> std::array&lt;double, 3&gt; product;</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> product[0] = (A[1] * B[2]) - (A[2] * B[1]);</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> product[1] = -((A[0] * B[2]) - (A[2] * B[0]));</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> product[2] = (A[0] * B[1]) - (A[1] * B[0]);</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <span class="keywordflow">return</span> product;</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> }</div>
</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> </div>
<div class="foldopen" id="foldopen00083" data-start="{" data-end="}">
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"><a class="line" href="../../df/d66/vector__cross__product_8cpp.html#a4b2a9757a87c18e1642d72410ecfaba8"> 83</a></span> <span class="keywordtype">double</span> <a class="code hl_function" href="../../df/d66/vector__cross__product_8cpp.html#a4b2a9757a87c18e1642d72410ecfaba8">mag</a>(<span class="keyword">const</span> std::array&lt;double, 3&gt; &amp;vec) {</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="keywordtype">double</span> magnitude = sqrt((vec[0] * vec[0]) + (vec[1] * vec[1]) + (vec[2] * vec[2]));</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="keywordflow">return</span> magnitude;</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> }</div>
</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> } </div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span>} </div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> </div>
<div class="foldopen" id="foldopen00094" data-start="{" data-end="}">
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"><a class="line" href="../../df/d66/vector__cross__product_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 94</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../df/d66/vector__cross__product_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> std::array&lt;double, 3&gt; t_vec = math::vector_cross::cross({1, 2, 3}, {4, 5, 6});</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> assert(t_vec[0] == -3 &amp;&amp; t_vec[1] == 6 &amp;&amp; t_vec[2] == -3);</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> </div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <span class="keywordtype">double</span> t_mag = math::vector_cross::mag({6, 8, 0});</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> assert(t_mag == 10);</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span>}</div>
</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> </div>
<div class="foldopen" id="foldopen00109" data-start="{" data-end="}">
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"><a class="line" href="../../df/d66/vector__cross__product_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 109</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../df/d66/vector__cross__product_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> </div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <a class="code hl_function" href="../../df/d66/vector__cross__product_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>();</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> </div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> std::array&lt;double, 3&gt; vec1;</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> std::array&lt;double, 3&gt; vec2;</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> </div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> std::cout &lt;&lt; <span class="stringliteral">&quot;\nPass the first Vector: &quot;</span>;</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> std::cin &gt;&gt; vec1[0] &gt;&gt; vec1[1] &gt;&gt; vec1[2];</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> </div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> std::cout &lt;&lt; <span class="stringliteral">&quot;\nPass the second Vector: &quot;</span>;</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> std::cin &gt;&gt; vec2[0] &gt;&gt; vec2[1] &gt;&gt; vec2[2];</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> </div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> std::array&lt;double, 3&gt; product = math::vector_cross::cross(vec1, vec2);</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> std::cout &lt;&lt; <span class="stringliteral">&quot;\nThe cross product is: &quot;</span> &lt;&lt; product[0] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; product[1] &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; product[2] &lt;&lt; std::endl;</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> </div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Magnitude: &quot;</span> &lt;&lt; math::vector_cross::mag(product) &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> </div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span>}</div>
</div>
<div class="ttc" id="anamespacemath_html"><div class="ttname"><a href="../../dd/d47/namespacemath.html">math</a></div><div class="ttdoc">for assert</div></div>
<div class="ttc" id="anamespacevector__cross_html"><div class="ttname"><a href="../../d4/d91/namespacevector__cross.html">vector_cross</a></div><div class="ttdoc">Functions for Vector Cross Product algorithms.</div></div>
<div class="ttc" id="avector__cross__product_8cpp_html_a225732399c5c076976eae5b180a9f8c9"><div class="ttname"><a href="../../df/d66/vector__cross__product_8cpp.html#a225732399c5c076976eae5b180a9f8c9">math::vector_cross::cross</a></div><div class="ttdeci">std::array&lt; double, 3 &gt; cross(const std::array&lt; double, 3 &gt; &amp;A, const std::array&lt; double, 3 &gt; &amp;B)</div><div class="ttdoc">Function to calculate the cross product of the passed arrays containing the direction ratios of the t...</div><div class="ttdef"><b>Definition</b> <a href="#l00069">vector_cross_product.cpp:69</a></div></div>
<div class="ttc" id="avector__cross__product_8cpp_html_a4b2a9757a87c18e1642d72410ecfaba8"><div class="ttname"><a href="../../df/d66/vector__cross__product_8cpp.html#a4b2a9757a87c18e1642d72410ecfaba8">math::vector_cross::mag</a></div><div class="ttdeci">double mag(const std::array&lt; double, 3 &gt; &amp;vec)</div><div class="ttdoc">Calculates the magnitude of the mathematical vector from it's direction ratios.</div><div class="ttdef"><b>Definition</b> <a href="#l00083">vector_cross_product.cpp:83</a></div></div>
<div class="ttc" id="avector__cross__product_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../df/d66/vector__cross__product_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">namespace math</div><div class="ttdef"><b>Definition</b> <a href="#l00094">vector_cross_product.cpp:94</a></div></div>
<div class="ttc" id="avector__cross__product_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../df/d66/vector__cross__product_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdoc">Main Function.</div><div class="ttdef"><b>Definition</b> <a href="#l00109">vector_cross_product.cpp:109</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_296d53ceaeaa7e099814a6def439fe8a.html">math</a></li><li class="navelem"><a class="el" href="../../df/d66/vector__cross__product_8cpp.html">vector_cross_product.cpp</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
</ul>
</div>
</body>
</html>