Documentation for c39d84b50b

This commit is contained in:
realstealthninja
2025-08-19 00:15:13 +00:00
parent 98266a5de5
commit e2f8e1a989
20 changed files with 271 additions and 226 deletions

View File

@@ -146,19 +146,24 @@ Macros</h2></td></tr>
Functions</h2></td></tr>
<tr class="memitem:ab00e9785fb2670f7af99d6f3d636f87c" id="r_ab00e9785fb2670f7af99d6f3d636f87c"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ab00e9785fb2670f7af99d6f3d636f87c">physics::ground_to_ground_projectile_motion::degrees_to_radians</a> (double degrees)</td></tr>
<tr class="memdesc:ab00e9785fb2670f7af99d6f3d636f87c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert radians to degrees. <br /></td></tr>
<tr class="memitem:a563e066975fed1b84750a0a47c3cbb37" id="r_a563e066975fed1b84750a0a47c3cbb37"><td class="memTemplParams" colspan="2">template&lt;typename T&gt; </td></tr>
<tr class="memitem:a563e066975fed1b84750a0a47c3cbb37 template"><td class="memItemLeft" align="right" valign="top">T&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a563e066975fed1b84750a0a47c3cbb37">physics::ground_to_ground_projectile_motion::time_of_flight</a> (T initial_velocity, T angle, double gravity=9.81)</td></tr>
<tr class="memdesc:a563e066975fed1b84750a0a47c3cbb37"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate the time of flight. <br /></td></tr>
<tr class="memitem:a483740fba6ebcc3cee3199e9b2e60b6b" id="r_a483740fba6ebcc3cee3199e9b2e60b6b"><td class="memTemplParams" colspan="2">template&lt;typename T&gt; </td></tr>
<tr class="memitem:a483740fba6ebcc3cee3199e9b2e60b6b template"><td class="memItemLeft" align="right" valign="top">T&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a483740fba6ebcc3cee3199e9b2e60b6b">physics::ground_to_ground_projectile_motion::time_of_flight</a> (T initial_velocity, T angle, double gravity=<a class="el" href="#a87aa13746e2b60524e028641493eaf5c">GRAVITY</a>)</td></tr>
<tr class="memdesc:a483740fba6ebcc3cee3199e9b2e60b6b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate the time of flight. <br /></td></tr>
<tr class="memitem:a10362eb607d7882bac3a0688504b00ff" id="r_a10362eb607d7882bac3a0688504b00ff"><td class="memTemplParams" colspan="2">template&lt;typename T&gt; </td></tr>
<tr class="memitem:a10362eb607d7882bac3a0688504b00ff template"><td class="memItemLeft" align="right" valign="top">T&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a10362eb607d7882bac3a0688504b00ff">physics::ground_to_ground_projectile_motion::horizontal_range</a> (T initial_velocity, T angle, T time)</td></tr>
<tr class="memdesc:a10362eb607d7882bac3a0688504b00ff"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate the horizontal distance that the projectile travels. <br /></td></tr>
<tr class="memitem:aa554429def63077ab7a550c0affbfefa" id="r_aa554429def63077ab7a550c0affbfefa"><td class="memTemplParams" colspan="2">template&lt;typename T&gt; </td></tr>
<tr class="memitem:aa554429def63077ab7a550c0affbfefa template"><td class="memItemLeft" align="right" valign="top">T&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aa554429def63077ab7a550c0affbfefa">physics::ground_to_ground_projectile_motion::max_height</a> (T initial_velocity, T angle, double gravity=9.81)</td></tr>
<tr class="memdesc:aa554429def63077ab7a550c0affbfefa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate the max height of the projectile. <br /></td></tr>
<tr class="memitem:a3e96cd0b24e64df01776d556ea569133" id="r_a3e96cd0b24e64df01776d556ea569133"><td class="memTemplParams" colspan="2">template&lt;typename T&gt; </td></tr>
<tr class="memitem:a3e96cd0b24e64df01776d556ea569133 template"><td class="memItemLeft" align="right" valign="top">T&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a3e96cd0b24e64df01776d556ea569133">physics::ground_to_ground_projectile_motion::max_height</a> (T initial_velocity, T angle, double gravity=<a class="el" href="#a87aa13746e2b60524e028641493eaf5c">GRAVITY</a>)</td></tr>
<tr class="memdesc:a3e96cd0b24e64df01776d556ea569133"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate the max height of the projectile. <br /></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>
<tr class="memdesc:aa8dca7b867074164d5f45b0f3851269d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Self-test implementations. <br /></td></tr>
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4" id="r_ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
<tr class="memdesc:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Main function. <br /></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 id="header-var-members" class="groupheader"><a id="var-members" name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a87aa13746e2b60524e028641493eaf5c" id="r_a87aa13746e2b60524e028641493eaf5c"><td class="memItemLeft" align="right" valign="top">constexpr double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a87aa13746e2b60524e028641493eaf5c">GRAVITY</a> = 9.80665</td></tr>
<tr class="memdesc:a87aa13746e2b60524e028641493eaf5c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Standard gravity (m/s^2) <br /></td></tr>
</table>
<a name="details" id="details"></a><h2 id="header-details" class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Ground to ground <a href="https://en.wikipedia.org/wiki/Projectile_motion" target="_blank">projectile motion</a> equation implementations. </p>
@@ -210,11 +215,11 @@ Functions</h2></td></tr>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Angle in degrees </dd></dl>
<p class="definition">Definition at line <a class="el" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html#l00034">34</a> of file <a class="el" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html">ground_to_ground_projectile_motion.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 34</span> {</div>
<div class="line"><span class="lineno"> 35</span> <span class="keywordtype">double</span> radians = degrees * (M_PI / 180);</div>
<div class="line"><span class="lineno"> 36</span> <span class="keywordflow">return</span> radians;</div>
<div class="line"><span class="lineno"> 37</span>}</div>
<p class="definition">Definition at line <a class="el" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html#l00039">39</a> of file <a class="el" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html">ground_to_ground_projectile_motion.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 39</span> {</div>
<div class="line"><span class="lineno"> 40</span> <span class="keywordtype">double</span> radians = degrees * (M_PI / 180);</div>
<div class="line"><span class="lineno"> 41</span> <span class="keywordflow">return</span> radians;</div>
<div class="line"><span class="lineno"> 42</span>}</div>
</div><!-- fragment -->
</div>
</div>
@@ -254,12 +259,12 @@ template&lt;typename T&gt; </div>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Horizontal distance that the projectile travels </dd></dl>
<p class="definition">Definition at line <a class="el" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html#l00059">59</a> of file <a class="el" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html">ground_to_ground_projectile_motion.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 59</span> {</div>
<div class="line"><span class="lineno"> 60</span> <span class="keywordtype">double</span> Vix = initial_velocity * (std::cos(<a class="code hl_function" href="#ab00e9785fb2670f7af99d6f3d636f87c">degrees_to_radians</a>(angle))); <span class="comment">// calculate x component of the initial velocity</span></div>
<div class="line"><span class="lineno"> 61</span> <span class="keywordflow">return</span> Vix * time;</div>
<div class="line"><span class="lineno"> 62</span>}</div>
<div class="ttc" id="aground__to__ground__projectile__motion_8cpp_html_ab00e9785fb2670f7af99d6f3d636f87c"><div class="ttname"><a href="#ab00e9785fb2670f7af99d6f3d636f87c">physics::ground_to_ground_projectile_motion::degrees_to_radians</a></div><div class="ttdeci">double degrees_to_radians(double degrees)</div><div class="ttdoc">Convert radians to degrees.</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html#l00034">ground_to_ground_projectile_motion.cpp:34</a></div></div>
<p class="definition">Definition at line <a class="el" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html#l00064">64</a> of file <a class="el" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html">ground_to_ground_projectile_motion.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 64</span> {</div>
<div class="line"><span class="lineno"> 65</span> <span class="keywordtype">double</span> Vix = initial_velocity * (std::cos(<a class="code hl_function" href="#ab00e9785fb2670f7af99d6f3d636f87c">degrees_to_radians</a>(angle))); <span class="comment">// calculate x component of the initial velocity</span></div>
<div class="line"><span class="lineno"> 66</span> <span class="keywordflow">return</span> Vix * time;</div>
<div class="line"><span class="lineno"> 67</span>}</div>
<div class="ttc" id="aground__to__ground__projectile__motion_8cpp_html_ab00e9785fb2670f7af99d6f3d636f87c"><div class="ttname"><a href="#ab00e9785fb2670f7af99d6f3d636f87c">physics::ground_to_ground_projectile_motion::degrees_to_radians</a></div><div class="ttdeci">double degrees_to_radians(double degrees)</div><div class="ttdoc">Convert radians to degrees.</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html#l00039">ground_to_ground_projectile_motion.cpp:39</a></div></div>
</div><!-- fragment -->
</div>
</div>
@@ -281,17 +286,17 @@ template&lt;typename T&gt; </div>
<p>Main function. </p>
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
<p class="definition">Definition at line <a class="el" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html#l00138">138</a> of file <a class="el" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html">ground_to_ground_projectile_motion.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 138</span> {</div>
<div class="line"><span class="lineno"> 139</span> <a class="code hl_function" href="#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
<div class="line"><span class="lineno"> 140</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><span class="lineno"> 141</span>}</div>
<div class="ttc" id="aground__to__ground__projectile__motion_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html#l00083">ground_to_ground_projectile_motion.cpp:83</a></div></div>
<p class="definition">Definition at line <a class="el" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html#l00143">143</a> of file <a class="el" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html">ground_to_ground_projectile_motion.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 143</span> {</div>
<div class="line"><span class="lineno"> 144</span> <a class="code hl_function" href="#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
<div class="line"><span class="lineno"> 145</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><span class="lineno"> 146</span>}</div>
<div class="ttc" id="aground__to__ground__projectile__motion_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html#l00088">ground_to_ground_projectile_motion.cpp:88</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a id="aa554429def63077ab7a550c0affbfefa" name="aa554429def63077ab7a550c0affbfefa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa554429def63077ab7a550c0affbfefa">&#9670;&#160;</a></span>max_height()</h2>
<a id="a3e96cd0b24e64df01776d556ea569133" name="a3e96cd0b24e64df01776d556ea569133"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3e96cd0b24e64df01776d556ea569133">&#9670;&#160;</a></span>max_height()</h2>
<div class="memitem">
<div class="memproto">
@@ -311,7 +316,7 @@ template&lt;typename T&gt; </div>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double</td> <td class="paramname"><span class="paramname"><em>gravity</em></span><span class="paramdefsep"> = </span><span class="paramdefval">9.81</span>&#160;)</td>
<td class="paramtype">double</td> <td class="paramname"><span class="paramname"><em>gravity</em></span><span class="paramdefsep"> = </span><span class="paramdefval"><a class="el" href="#a87aa13746e2b60524e028641493eaf5c">GRAVITY</a></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
@@ -327,11 +332,11 @@ template&lt;typename T&gt; </div>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The max height that the projectile reaches </dd></dl>
<p class="definition">Definition at line <a class="el" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html#l00072">72</a> of file <a class="el" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html">ground_to_ground_projectile_motion.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 72</span> {</div>
<div class="line"><span class="lineno"> 73</span> <span class="keywordtype">double</span> Viy = initial_velocity * (std::sin(<a class="code hl_function" href="#ab00e9785fb2670f7af99d6f3d636f87c">degrees_to_radians</a>(angle))); <span class="comment">// calculate y component of the initial velocity</span></div>
<div class="line"><span class="lineno"> 74</span> <span class="keywordflow">return</span> (std::pow(Viy, 2) / (2.0 * gravity));</div>
<div class="line"><span class="lineno"> 75</span>}</div>
<p class="definition">Definition at line <a class="el" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html#l00077">77</a> of file <a class="el" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html">ground_to_ground_projectile_motion.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 77</span> {</div>
<div class="line"><span class="lineno"> 78</span> <span class="keywordtype">double</span> Viy = initial_velocity * (std::sin(<a class="code hl_function" href="#ab00e9785fb2670f7af99d6f3d636f87c">degrees_to_radians</a>(angle))); <span class="comment">// calculate y component of the initial velocity</span></div>
<div class="line"><span class="lineno"> 79</span> <span class="keywordflow">return</span> (std::pow(Viy, 2) / (2.0 * gravity));</div>
<div class="line"><span class="lineno"> 80</span>}</div>
</div><!-- fragment -->
</div>
</div>
@@ -361,65 +366,65 @@ template&lt;typename T&gt; </div>
<p>Self-test implementations. </p>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<p class="definition">Definition at line <a class="el" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html#l00083">83</a> of file <a class="el" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html">ground_to_ground_projectile_motion.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="comment">// initial input variables</span></div>
<div class="line"><span class="lineno"> 85</span> <span class="keywordtype">double</span> initial_velocity = 5.0; <span class="comment">// double initial_velocity input</span></div>
<div class="line"><span class="lineno"> 86</span> <span class="keywordtype">double</span> angle = 40.0; <span class="comment">// double angle input</span></div>
<div class="line"><span class="lineno"> 87</span> </div>
<div class="line"><span class="lineno"> 88</span> <span class="comment">// 1st test</span></div>
<div class="line"><span class="lineno"> 89</span> <span class="keywordtype">double</span> expected_time_of_flight = 0.655; <span class="comment">// expected time output</span></div>
<div class="line"><span class="lineno"> 90</span> <span class="keywordtype">double</span> flight_time_output =</div>
<div class="line"><span class="lineno"> 91</span> std::round(<a class="code hl_function" href="#a563e066975fed1b84750a0a47c3cbb37">physics::ground_to_ground_projectile_motion::time_of_flight</a>(initial_velocity, angle) * 1000.0) /</div>
<div class="line"><span class="lineno"> 92</span> 1000.0; <span class="comment">// round output to 3 decimal places</span></div>
<div class="line"><span class="lineno"> 93</span> </div>
<div class="line"><span class="lineno"> 94</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Projectile Flight Time (double)&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 95</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Input Initial Velocity: &quot;</span> &lt;&lt; initial_velocity &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 96</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Input Angle: &quot;</span> &lt;&lt; angle &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 97</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Expected Output: &quot;</span> &lt;&lt; expected_time_of_flight &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 98</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Output: &quot;</span> &lt;&lt; flight_time_output &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 99</span> assert(flight_time_output == expected_time_of_flight);</div>
<div class="line"><span class="lineno"> 100</span> std::cout &lt;&lt; <span class="stringliteral">&quot;TEST PASSED&quot;</span> &lt;&lt; std::endl &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 101</span> </div>
<div class="line"><span class="lineno"> 102</span> <span class="comment">// 2nd test</span></div>
<div class="line"><span class="lineno"> 103</span> <span class="keywordtype">double</span> expected_horizontal_range = 2.51; <span class="comment">// expected range output</span></div>
<div class="line"><span class="lineno"> 104</span> <span class="keywordtype">double</span> horizontal_range_output =</div>
<div class="line"><span class="lineno"> 105</span> std::round(<a class="code hl_function" href="#a10362eb607d7882bac3a0688504b00ff">physics::ground_to_ground_projectile_motion::horizontal_range</a>(initial_velocity, angle,</div>
<div class="line"><span class="lineno"> 106</span> flight_time_output) *</div>
<div class="line"><span class="lineno"> 107</span> 100.0) /</div>
<div class="line"><span class="lineno"> 108</span> 100.0; <span class="comment">// round output to 2 decimal places</span></div>
<div class="line"><span class="lineno"> 109</span> </div>
<div class="line"><span class="lineno"> 110</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Projectile Horizontal Range (double)&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 111</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Input Initial Velocity: &quot;</span> &lt;&lt; initial_velocity &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 112</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Input Angle: &quot;</span> &lt;&lt; angle &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 113</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Input Time Of Flight: &quot;</span> &lt;&lt; flight_time_output &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 114</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Expected Output: &quot;</span> &lt;&lt; expected_horizontal_range &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 115</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Output: &quot;</span> &lt;&lt; horizontal_range_output &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 116</span> assert(horizontal_range_output == expected_horizontal_range);</div>
<div class="line"><span class="lineno"> 117</span> std::cout &lt;&lt; <span class="stringliteral">&quot;TEST PASSED&quot;</span> &lt;&lt; std::endl &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 118</span> </div>
<div class="line"><span class="lineno"> 119</span> <span class="comment">// 3rd test</span></div>
<div class="line"><span class="lineno"> 120</span> <span class="keywordtype">double</span> expected_max_height = 0.526; <span class="comment">// expected height output</span></div>
<div class="line"><span class="lineno"> 121</span> <span class="keywordtype">double</span> max_height_output =</div>
<div class="line"><span class="lineno"> 122</span> std::round(<a class="code hl_function" href="#aa554429def63077ab7a550c0affbfefa">physics::ground_to_ground_projectile_motion::max_height</a>(initial_velocity, angle) * 1000.0) /</div>
<div class="line"><span class="lineno"> 123</span> 1000.0; <span class="comment">// round output to 3 decimal places</span></div>
<div class="line"><span class="lineno"> 124</span> </div>
<div class="line"><span class="lineno"> 125</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Projectile Max Height (double)&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 126</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Input Initial Velocity: &quot;</span> &lt;&lt; initial_velocity &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 127</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Input Angle: &quot;</span> &lt;&lt; angle &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 128</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Expected Output: &quot;</span> &lt;&lt; expected_max_height &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 129</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Output: &quot;</span> &lt;&lt; max_height_output &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 130</span> assert(max_height_output == expected_max_height);</div>
<div class="line"><span class="lineno"> 131</span> std::cout &lt;&lt; <span class="stringliteral">&quot;TEST PASSED&quot;</span> &lt;&lt; std::endl &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 132</span>}</div>
<div class="ttc" id="aground__to__ground__projectile__motion_8cpp_html_a10362eb607d7882bac3a0688504b00ff"><div class="ttname"><a href="#a10362eb607d7882bac3a0688504b00ff">physics::ground_to_ground_projectile_motion::horizontal_range</a></div><div class="ttdeci">T horizontal_range(T initial_velocity, T angle, T time)</div><div class="ttdoc">Calculate the horizontal distance that the projectile travels.</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html#l00059">ground_to_ground_projectile_motion.cpp:59</a></div></div>
<div class="ttc" id="aground__to__ground__projectile__motion_8cpp_html_a563e066975fed1b84750a0a47c3cbb37"><div class="ttname"><a href="#a563e066975fed1b84750a0a47c3cbb37">physics::ground_to_ground_projectile_motion::time_of_flight</a></div><div class="ttdeci">T time_of_flight(T initial_velocity, T angle, double gravity=9.81)</div><div class="ttdoc">Calculate the time of flight.</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html#l00047">ground_to_ground_projectile_motion.cpp:47</a></div></div>
<div class="ttc" id="aground__to__ground__projectile__motion_8cpp_html_aa554429def63077ab7a550c0affbfefa"><div class="ttname"><a href="#aa554429def63077ab7a550c0affbfefa">physics::ground_to_ground_projectile_motion::max_height</a></div><div class="ttdeci">T max_height(T initial_velocity, T angle, double gravity=9.81)</div><div class="ttdoc">Calculate the max height of the projectile.</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html#l00072">ground_to_ground_projectile_motion.cpp:72</a></div></div>
<p class="definition">Definition at line <a class="el" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html#l00088">88</a> of file <a class="el" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html">ground_to_ground_projectile_motion.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 88</span> {</div>
<div class="line"><span class="lineno"> 89</span> <span class="comment">// initial input variables</span></div>
<div class="line"><span class="lineno"> 90</span> <span class="keywordtype">double</span> initial_velocity = 5.0; <span class="comment">// double initial_velocity input</span></div>
<div class="line"><span class="lineno"> 91</span> <span class="keywordtype">double</span> angle = 40.0; <span class="comment">// double angle input</span></div>
<div class="line"><span class="lineno"> 92</span> </div>
<div class="line"><span class="lineno"> 93</span> <span class="comment">// 1st test</span></div>
<div class="line"><span class="lineno"> 94</span> <span class="keywordtype">double</span> expected_time_of_flight = 0.655; <span class="comment">// expected time output</span></div>
<div class="line"><span class="lineno"> 95</span> <span class="keywordtype">double</span> flight_time_output =</div>
<div class="line"><span class="lineno"> 96</span> std::round(<a class="code hl_function" href="#a483740fba6ebcc3cee3199e9b2e60b6b">physics::ground_to_ground_projectile_motion::time_of_flight</a>(initial_velocity, angle) * 1000.0) /</div>
<div class="line"><span class="lineno"> 97</span> 1000.0; <span class="comment">// round output to 3 decimal places</span></div>
<div class="line"><span class="lineno"> 98</span> </div>
<div class="line"><span class="lineno"> 99</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Projectile Flight Time (double)&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 100</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Input Initial Velocity: &quot;</span> &lt;&lt; initial_velocity &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 101</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Input Angle: &quot;</span> &lt;&lt; angle &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 102</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Expected Output: &quot;</span> &lt;&lt; expected_time_of_flight &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 103</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Output: &quot;</span> &lt;&lt; flight_time_output &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 104</span> assert(flight_time_output == expected_time_of_flight);</div>
<div class="line"><span class="lineno"> 105</span> std::cout &lt;&lt; <span class="stringliteral">&quot;TEST PASSED&quot;</span> &lt;&lt; std::endl &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 106</span> </div>
<div class="line"><span class="lineno"> 107</span> <span class="comment">// 2nd test</span></div>
<div class="line"><span class="lineno"> 108</span> <span class="keywordtype">double</span> expected_horizontal_range = 2.51; <span class="comment">// expected range output</span></div>
<div class="line"><span class="lineno"> 109</span> <span class="keywordtype">double</span> horizontal_range_output =</div>
<div class="line"><span class="lineno"> 110</span> std::round(<a class="code hl_function" href="#a10362eb607d7882bac3a0688504b00ff">physics::ground_to_ground_projectile_motion::horizontal_range</a>(initial_velocity, angle,</div>
<div class="line"><span class="lineno"> 111</span> flight_time_output) *</div>
<div class="line"><span class="lineno"> 112</span> 100.0) /</div>
<div class="line"><span class="lineno"> 113</span> 100.0; <span class="comment">// round output to 2 decimal places</span></div>
<div class="line"><span class="lineno"> 114</span> </div>
<div class="line"><span class="lineno"> 115</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Projectile Horizontal Range (double)&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 116</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Input Initial Velocity: &quot;</span> &lt;&lt; initial_velocity &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 117</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Input Angle: &quot;</span> &lt;&lt; angle &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 118</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Input Time Of Flight: &quot;</span> &lt;&lt; flight_time_output &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 119</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Expected Output: &quot;</span> &lt;&lt; expected_horizontal_range &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 120</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Output: &quot;</span> &lt;&lt; horizontal_range_output &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 121</span> assert(horizontal_range_output == expected_horizontal_range);</div>
<div class="line"><span class="lineno"> 122</span> std::cout &lt;&lt; <span class="stringliteral">&quot;TEST PASSED&quot;</span> &lt;&lt; std::endl &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 123</span> </div>
<div class="line"><span class="lineno"> 124</span> <span class="comment">// 3rd test</span></div>
<div class="line"><span class="lineno"> 125</span> <span class="keywordtype">double</span> expected_max_height = 0.526; <span class="comment">// expected height output</span></div>
<div class="line"><span class="lineno"> 126</span> <span class="keywordtype">double</span> max_height_output =</div>
<div class="line"><span class="lineno"> 127</span> std::round(<a class="code hl_function" href="#a3e96cd0b24e64df01776d556ea569133">physics::ground_to_ground_projectile_motion::max_height</a>(initial_velocity, angle) * 1000.0) /</div>
<div class="line"><span class="lineno"> 128</span> 1000.0; <span class="comment">// round output to 3 decimal places</span></div>
<div class="line"><span class="lineno"> 129</span> </div>
<div class="line"><span class="lineno"> 130</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Projectile Max Height (double)&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 131</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Input Initial Velocity: &quot;</span> &lt;&lt; initial_velocity &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 132</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Input Angle: &quot;</span> &lt;&lt; angle &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 133</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Expected Output: &quot;</span> &lt;&lt; expected_max_height &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 134</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Output: &quot;</span> &lt;&lt; max_height_output &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 135</span> assert(max_height_output == expected_max_height);</div>
<div class="line"><span class="lineno"> 136</span> std::cout &lt;&lt; <span class="stringliteral">&quot;TEST PASSED&quot;</span> &lt;&lt; std::endl &lt;&lt; std::endl;</div>
<div class="line"><span class="lineno"> 137</span>}</div>
<div class="ttc" id="aground__to__ground__projectile__motion_8cpp_html_a10362eb607d7882bac3a0688504b00ff"><div class="ttname"><a href="#a10362eb607d7882bac3a0688504b00ff">physics::ground_to_ground_projectile_motion::horizontal_range</a></div><div class="ttdeci">T horizontal_range(T initial_velocity, T angle, T time)</div><div class="ttdoc">Calculate the horizontal distance that the projectile travels.</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html#l00064">ground_to_ground_projectile_motion.cpp:64</a></div></div>
<div class="ttc" id="aground__to__ground__projectile__motion_8cpp_html_a3e96cd0b24e64df01776d556ea569133"><div class="ttname"><a href="#a3e96cd0b24e64df01776d556ea569133">physics::ground_to_ground_projectile_motion::max_height</a></div><div class="ttdeci">T max_height(T initial_velocity, T angle, double gravity=GRAVITY)</div><div class="ttdoc">Calculate the max height of the projectile.</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html#l00077">ground_to_ground_projectile_motion.cpp:77</a></div></div>
<div class="ttc" id="aground__to__ground__projectile__motion_8cpp_html_a483740fba6ebcc3cee3199e9b2e60b6b"><div class="ttname"><a href="#a483740fba6ebcc3cee3199e9b2e60b6b">physics::ground_to_ground_projectile_motion::time_of_flight</a></div><div class="ttdeci">T time_of_flight(T initial_velocity, T angle, double gravity=GRAVITY)</div><div class="ttdoc">Calculate the time of flight.</div><div class="ttdef"><b>Definition</b> <a href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html#l00052">ground_to_ground_projectile_motion.cpp:52</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a id="a563e066975fed1b84750a0a47c3cbb37" name="a563e066975fed1b84750a0a47c3cbb37"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a563e066975fed1b84750a0a47c3cbb37">&#9670;&#160;</a></span>time_of_flight()</h2>
<a id="a483740fba6ebcc3cee3199e9b2e60b6b" name="a483740fba6ebcc3cee3199e9b2e60b6b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a483740fba6ebcc3cee3199e9b2e60b6b">&#9670;&#160;</a></span>time_of_flight()</h2>
<div class="memitem">
<div class="memproto">
@@ -439,7 +444,7 @@ template&lt;typename T&gt; </div>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double</td> <td class="paramname"><span class="paramname"><em>gravity</em></span><span class="paramdefsep"> = </span><span class="paramdefval">9.81</span>&#160;)</td>
<td class="paramtype">double</td> <td class="paramname"><span class="paramname"><em>gravity</em></span><span class="paramdefsep"> = </span><span class="paramdefval"><a class="el" href="#a87aa13746e2b60524e028641493eaf5c">GRAVITY</a></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
@@ -455,12 +460,39 @@ template&lt;typename T&gt; </div>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The time that the projectile is in the air for </dd></dl>
<p class="definition">Definition at line <a class="el" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html#l00047">47</a> of file <a class="el" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html">ground_to_ground_projectile_motion.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 47</span> {</div>
<div class="line"><span class="lineno"> 48</span> <span class="keywordtype">double</span> Viy = initial_velocity * (std::sin(<a class="code hl_function" href="#ab00e9785fb2670f7af99d6f3d636f87c">degrees_to_radians</a>(angle))); <span class="comment">// calculate y component of the initial velocity</span></div>
<div class="line"><span class="lineno"> 49</span> <span class="keywordflow">return</span> 2.0 * Viy / gravity;</div>
<div class="line"><span class="lineno"> 50</span>}</div>
<p class="definition">Definition at line <a class="el" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html#l00052">52</a> of file <a class="el" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html">ground_to_ground_projectile_motion.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 52</span> {</div>
<div class="line"><span class="lineno"> 53</span> <span class="keywordtype">double</span> Viy = initial_velocity * (std::sin(<a class="code hl_function" href="#ab00e9785fb2670f7af99d6f3d636f87c">degrees_to_radians</a>(angle))); <span class="comment">// calculate y component of the initial velocity</span></div>
<div class="line"><span class="lineno"> 54</span> <span class="keywordflow">return</span> 2.0 * Viy / gravity;</div>
<div class="line"><span class="lineno"> 55</span>}</div>
</div><!-- fragment -->
</div>
</div>
<a name="doc-var-members" id="doc-var-members"></a><h2 id="header-doc-var-members" class="groupheader">Variable Documentation</h2>
<a id="a87aa13746e2b60524e028641493eaf5c" name="a87aa13746e2b60524e028641493eaf5c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a87aa13746e2b60524e028641493eaf5c">&#9670;&#160;</a></span>GRAVITY</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">double GRAVITY = 9.80665</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel constexpr">constexpr</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Standard gravity (m/s^2) </p>
<p class="definition">Definition at line <a class="el" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html#l00023">23</a> of file <a class="el" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp_source.html">ground_to_ground_projectile_motion.cpp</a>.</p>
</div>
</div>
</div><!-- contents -->

View File

@@ -4,7 +4,8 @@ var ground__to__ground__projectile__motion_8cpp =
[ "physics::ground_to_ground_projectile_motion::degrees_to_radians", "d9/d29/ground__to__ground__projectile__motion_8cpp.html#ab00e9785fb2670f7af99d6f3d636f87c", null ],
[ "physics::ground_to_ground_projectile_motion::horizontal_range", "d9/d29/ground__to__ground__projectile__motion_8cpp.html#a10362eb607d7882bac3a0688504b00ff", null ],
[ "main", "d9/d29/ground__to__ground__projectile__motion_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
[ "physics::ground_to_ground_projectile_motion::max_height", "d9/d29/ground__to__ground__projectile__motion_8cpp.html#aa554429def63077ab7a550c0affbfefa", null ],
[ "physics::ground_to_ground_projectile_motion::max_height", "d9/d29/ground__to__ground__projectile__motion_8cpp.html#a3e96cd0b24e64df01776d556ea569133", null ],
[ "test", "d9/d29/ground__to__ground__projectile__motion_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ],
[ "physics::ground_to_ground_projectile_motion::time_of_flight", "d9/d29/ground__to__ground__projectile__motion_8cpp.html#a563e066975fed1b84750a0a47c3cbb37", null ]
[ "physics::ground_to_ground_projectile_motion::time_of_flight", "d9/d29/ground__to__ground__projectile__motion_8cpp.html#a483740fba6ebcc3cee3199e9b2e60b6b", null ],
[ "GRAVITY", "d9/d29/ground__to__ground__projectile__motion_8cpp.html#a87aa13746e2b60524e028641493eaf5c", null ]
];

View File

@@ -123,107 +123,113 @@ $(function(){initNavTree('d9/d29/ground__to__ground__projectile__motion_8cpp_sou
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include &lt;cmath&gt;</span> </div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include &lt;iostream&gt;</span> </div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d5/dd0/namespacephysics.html">physics</a> {</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d0/d20/namespaceground__to__ground__projectile__motion.html">ground_to_ground_projectile_motion</a> {</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> </div>
<div class="foldopen" id="foldopen00034" data-start="{" data-end="}">
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#ab00e9785fb2670f7af99d6f3d636f87c"> 34</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#ab00e9785fb2670f7af99d6f3d636f87c">degrees_to_radians</a>(<span class="keywordtype">double</span> degrees){</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="keywordtype">double</span> radians = degrees * (M_PI / 180);</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="keywordflow">return</span> radians;</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span>}</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> </div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="comment">// Define gravity as a constant within guidelines</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"><a class="line" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a87aa13746e2b60524e028641493eaf5c"> 23</a></span><span class="keyword">constexpr</span> <span class="keywordtype">double</span> <a class="code hl_variable" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a87aa13746e2b60524e028641493eaf5c">GRAVITY</a> = 9.80665; </div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> </div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> </div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d5/dd0/namespacephysics.html">physics</a> {</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d0/d20/namespaceground__to__ground__projectile__motion.html">ground_to_ground_projectile_motion</a> {</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> </div>
<div class="foldopen" id="foldopen00039" data-start="{" data-end="}">
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#ab00e9785fb2670f7af99d6f3d636f87c"> 39</a></span><span class="keywordtype">double</span> <a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#ab00e9785fb2670f7af99d6f3d636f87c">degrees_to_radians</a>(<span class="keywordtype">double</span> degrees){</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <span class="keywordtype">double</span> radians = degrees * (M_PI / 180);</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="keywordflow">return</span> radians;</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span>}</div>
</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00047" data-start="{" data-end="}">
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a563e066975fed1b84750a0a47c3cbb37"> 47</a></span>T <a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a563e066975fed1b84750a0a47c3cbb37">time_of_flight</a>(T initial_velocity, T angle, <span class="keywordtype">double</span> gravity = 9.81) {</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keywordtype">double</span> Viy = initial_velocity * (std::sin(<a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#ab00e9785fb2670f7af99d6f3d636f87c">degrees_to_radians</a>(angle))); <span class="comment">// calculate y component of the initial velocity</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="keywordflow">return</span> 2.0 * Viy / gravity;</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span>}</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span></div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00052" data-start="{" data-end="}">
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"><a class="line" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a483740fba6ebcc3cee3199e9b2e60b6b"> 52</a></span>T <a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a483740fba6ebcc3cee3199e9b2e60b6b">time_of_flight</a>(T initial_velocity, T angle, <span class="keywordtype">double</span> gravity = <a class="code hl_variable" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a87aa13746e2b60524e028641493eaf5c">GRAVITY</a>) {</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <span class="keywordtype">double</span> Viy = initial_velocity * (std::sin(<a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#ab00e9785fb2670f7af99d6f3d636f87c">degrees_to_radians</a>(angle))); <span class="comment">// calculate y component of the initial velocity</span></div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <span class="keywordflow">return</span> 2.0 * Viy / gravity;</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span>}</div>
</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span></div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00059" data-start="{" data-end="}">
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"><a class="line" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a10362eb607d7882bac3a0688504b00ff"> 59</a></span>T <a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a10362eb607d7882bac3a0688504b00ff">horizontal_range</a>(T initial_velocity, T angle, T time) {</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> <span class="keywordtype">double</span> Vix = initial_velocity * (std::cos(<a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#ab00e9785fb2670f7af99d6f3d636f87c">degrees_to_radians</a>(angle))); <span class="comment">// calculate x component of the initial velocity</span></div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="keywordflow">return</span> Vix * time;</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span>}</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span></div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00064" data-start="{" data-end="}">
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"><a class="line" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a10362eb607d7882bac3a0688504b00ff"> 64</a></span>T <a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a10362eb607d7882bac3a0688504b00ff">horizontal_range</a>(T initial_velocity, T angle, T time) {</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keywordtype">double</span> Vix = initial_velocity * (std::cos(<a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#ab00e9785fb2670f7af99d6f3d636f87c">degrees_to_radians</a>(angle))); <span class="comment">// calculate x component of the initial velocity</span></div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="keywordflow">return</span> Vix * time;</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span>}</div>
</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span></div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00072" data-start="{" data-end="}">
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"><a class="line" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#aa554429def63077ab7a550c0affbfefa"> 72</a></span>T <a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#aa554429def63077ab7a550c0affbfefa">max_height</a>(T initial_velocity, T angle, <span class="keywordtype">double</span> gravity = 9.81) {</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="keywordtype">double</span> Viy = initial_velocity * (std::sin(<a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#ab00e9785fb2670f7af99d6f3d636f87c">degrees_to_radians</a>(angle))); <span class="comment">// calculate y component of the initial velocity</span></div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <span class="keywordflow">return</span> (std::pow(Viy, 2) / (2.0 * gravity));</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span>}</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span></div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span><span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00077" data-start="{" data-end="}">
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"><a class="line" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a3e96cd0b24e64df01776d556ea569133"> 77</a></span>T <a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a3e96cd0b24e64df01776d556ea569133">max_height</a>(T initial_velocity, T angle, <span class="keywordtype">double</span> gravity = <a class="code hl_variable" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a87aa13746e2b60524e028641493eaf5c">GRAVITY</a>) {</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="keywordtype">double</span> Viy = initial_velocity * (std::sin(<a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#ab00e9785fb2670f7af99d6f3d636f87c">degrees_to_radians</a>(angle))); <span class="comment">// calculate y component of the initial velocity</span></div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="keywordflow">return</span> (std::pow(Viy, 2) / (2.0 * gravity));</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span>}</div>
</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span>} <span class="comment">// namespace ground_to_ground_projectile_motion</span></div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span>} <span class="comment">// namespace physics</span></div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</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="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 83</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="comment">// initial input variables</span></div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="keywordtype">double</span> initial_velocity = 5.0; <span class="comment">// double initial_velocity input</span></div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="keywordtype">double</span> angle = 40.0; <span class="comment">// double angle input</span></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> <span class="comment">// 1st test</span></div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> <span class="keywordtype">double</span> expected_time_of_flight = 0.655; <span class="comment">// expected time output</span></div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="keywordtype">double</span> flight_time_output =</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> std::round(<a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a563e066975fed1b84750a0a47c3cbb37">physics::ground_to_ground_projectile_motion::time_of_flight</a>(initial_velocity, angle) * 1000.0) /</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> 1000.0; <span class="comment">// round output to 3 decimal places</span></div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> </div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Projectile Flight Time (double)&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Input Initial Velocity: &quot;</span> &lt;&lt; initial_velocity &lt;&lt; std::endl;</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Input Angle: &quot;</span> &lt;&lt; angle &lt;&lt; std::endl;</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Expected Output: &quot;</span> &lt;&lt; expected_time_of_flight &lt;&lt; std::endl;</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Output: &quot;</span> &lt;&lt; flight_time_output &lt;&lt; std::endl;</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> assert(flight_time_output == expected_time_of_flight);</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> std::cout &lt;&lt; <span class="stringliteral">&quot;TEST PASSED&quot;</span> &lt;&lt; std::endl &lt;&lt; std::endl;</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> </div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="comment">// 2nd test</span></div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <span class="keywordtype">double</span> expected_horizontal_range = 2.51; <span class="comment">// expected range output</span></div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <span class="keywordtype">double</span> horizontal_range_output =</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> std::round(<a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a10362eb607d7882bac3a0688504b00ff">physics::ground_to_ground_projectile_motion::horizontal_range</a>(initial_velocity, angle,</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> flight_time_output) *</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> 100.0) /</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> 100.0; <span class="comment">// round output to 2 decimal places</span></div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> </div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Projectile Horizontal Range (double)&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Input Initial Velocity: &quot;</span> &lt;&lt; initial_velocity &lt;&lt; std::endl;</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Input Angle: &quot;</span> &lt;&lt; angle &lt;&lt; std::endl;</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Input Time Of Flight: &quot;</span> &lt;&lt; flight_time_output &lt;&lt; std::endl;</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Expected Output: &quot;</span> &lt;&lt; expected_horizontal_range &lt;&lt; std::endl;</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Output: &quot;</span> &lt;&lt; horizontal_range_output &lt;&lt; std::endl;</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> assert(horizontal_range_output == expected_horizontal_range);</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> std::cout &lt;&lt; <span class="stringliteral">&quot;TEST PASSED&quot;</span> &lt;&lt; std::endl &lt;&lt; std::endl;</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> </div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <span class="comment">// 3rd test</span></div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> <span class="keywordtype">double</span> expected_max_height = 0.526; <span class="comment">// expected height output</span></div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <span class="keywordtype">double</span> max_height_output =</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> std::round(<a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#aa554429def63077ab7a550c0affbfefa">physics::ground_to_ground_projectile_motion::max_height</a>(initial_velocity, angle) * 1000.0) /</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> 1000.0; <span class="comment">// round output to 3 decimal places</span></div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> </div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Projectile Max Height (double)&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Input Initial Velocity: &quot;</span> &lt;&lt; initial_velocity &lt;&lt; std::endl;</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Input Angle: &quot;</span> &lt;&lt; angle &lt;&lt; std::endl;</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Expected Output: &quot;</span> &lt;&lt; expected_max_height &lt;&lt; std::endl;</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Output: &quot;</span> &lt;&lt; max_height_output &lt;&lt; std::endl;</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> assert(max_height_output == expected_max_height);</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> std::cout &lt;&lt; <span class="stringliteral">&quot;TEST PASSED&quot;</span> &lt;&lt; std::endl &lt;&lt; std::endl;</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span>}</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span>} <span class="comment">// namespace ground_to_ground_projectile_motion</span></div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span>} <span class="comment">// namespace physics</span></div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span></div>
<div class="foldopen" id="foldopen00088" data-start="{" data-end="}">
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"><a class="line" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 88</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> <span class="comment">// initial input variables</span></div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="keywordtype">double</span> initial_velocity = 5.0; <span class="comment">// double initial_velocity input</span></div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <span class="keywordtype">double</span> angle = 40.0; <span class="comment">// double angle input</span></div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> </div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <span class="comment">// 1st test</span></div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="keywordtype">double</span> expected_time_of_flight = 0.655; <span class="comment">// expected time output</span></div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <span class="keywordtype">double</span> flight_time_output =</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> std::round(<a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a483740fba6ebcc3cee3199e9b2e60b6b">physics::ground_to_ground_projectile_motion::time_of_flight</a>(initial_velocity, angle) * 1000.0) /</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> 1000.0; <span class="comment">// round output to 3 decimal places</span></div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> </div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Projectile Flight Time (double)&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Input Initial Velocity: &quot;</span> &lt;&lt; initial_velocity &lt;&lt; std::endl;</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Input Angle: &quot;</span> &lt;&lt; angle &lt;&lt; std::endl;</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Expected Output: &quot;</span> &lt;&lt; expected_time_of_flight &lt;&lt; std::endl;</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Output: &quot;</span> &lt;&lt; flight_time_output &lt;&lt; std::endl;</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> assert(flight_time_output == expected_time_of_flight);</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> std::cout &lt;&lt; <span class="stringliteral">&quot;TEST PASSED&quot;</span> &lt;&lt; std::endl &lt;&lt; std::endl;</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> </div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="comment">// 2nd test</span></div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <span class="keywordtype">double</span> expected_horizontal_range = 2.51; <span class="comment">// expected range output</span></div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <span class="keywordtype">double</span> horizontal_range_output =</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> std::round(<a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a10362eb607d7882bac3a0688504b00ff">physics::ground_to_ground_projectile_motion::horizontal_range</a>(initial_velocity, angle,</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> flight_time_output) *</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> 100.0) /</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> 100.0; <span class="comment">// round output to 2 decimal places</span></div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> </div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Projectile Horizontal Range (double)&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Input Initial Velocity: &quot;</span> &lt;&lt; initial_velocity &lt;&lt; std::endl;</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Input Angle: &quot;</span> &lt;&lt; angle &lt;&lt; std::endl;</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Input Time Of Flight: &quot;</span> &lt;&lt; flight_time_output &lt;&lt; std::endl;</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Expected Output: &quot;</span> &lt;&lt; expected_horizontal_range &lt;&lt; std::endl;</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Output: &quot;</span> &lt;&lt; horizontal_range_output &lt;&lt; std::endl;</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> assert(horizontal_range_output == expected_horizontal_range);</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> std::cout &lt;&lt; <span class="stringliteral">&quot;TEST PASSED&quot;</span> &lt;&lt; std::endl &lt;&lt; std::endl;</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> </div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> <span class="comment">// 3rd test</span></div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> <span class="keywordtype">double</span> expected_max_height = 0.526; <span class="comment">// expected height output</span></div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <span class="keywordtype">double</span> max_height_output =</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> std::round(<a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a3e96cd0b24e64df01776d556ea569133">physics::ground_to_ground_projectile_motion::max_height</a>(initial_velocity, angle) * 1000.0) /</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> 1000.0; <span class="comment">// round output to 3 decimal places</span></div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> </div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Projectile Max Height (double)&quot;</span> &lt;&lt; std::endl;</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Input Initial Velocity: &quot;</span> &lt;&lt; initial_velocity &lt;&lt; std::endl;</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Input Angle: &quot;</span> &lt;&lt; angle &lt;&lt; std::endl;</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Expected Output: &quot;</span> &lt;&lt; expected_max_height &lt;&lt; std::endl;</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> std::cout &lt;&lt; <span class="stringliteral">&quot;Output: &quot;</span> &lt;&lt; max_height_output &lt;&lt; std::endl;</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> assert(max_height_output == expected_max_height);</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> std::cout &lt;&lt; <span class="stringliteral">&quot;TEST PASSED&quot;</span> &lt;&lt; std::endl &lt;&lt; std::endl;</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span>}</div>
</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span></div>
<div class="foldopen" id="foldopen00138" data-start="{" data-end="}">
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"><a class="line" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 138</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> <a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span>}</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span></div>
<div class="foldopen" id="foldopen00143" data-start="{" data-end="}">
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"><a class="line" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 143</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <a class="code hl_function" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span>}</div>
</div>
<div class="ttc" id="aground__to__ground__projectile__motion_8cpp_html_a10362eb607d7882bac3a0688504b00ff"><div class="ttname"><a href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a10362eb607d7882bac3a0688504b00ff">physics::ground_to_ground_projectile_motion::horizontal_range</a></div><div class="ttdeci">T horizontal_range(T initial_velocity, T angle, T time)</div><div class="ttdoc">Calculate the horizontal distance that the projectile travels.</div><div class="ttdef"><b>Definition</b> <a href="#l00059">ground_to_ground_projectile_motion.cpp:59</a></div></div>
<div class="ttc" id="aground__to__ground__projectile__motion_8cpp_html_a563e066975fed1b84750a0a47c3cbb37"><div class="ttname"><a href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a563e066975fed1b84750a0a47c3cbb37">physics::ground_to_ground_projectile_motion::time_of_flight</a></div><div class="ttdeci">T time_of_flight(T initial_velocity, T angle, double gravity=9.81)</div><div class="ttdoc">Calculate the time of flight.</div><div class="ttdef"><b>Definition</b> <a href="#l00047">ground_to_ground_projectile_motion.cpp:47</a></div></div>
<div class="ttc" id="aground__to__ground__projectile__motion_8cpp_html_aa554429def63077ab7a550c0affbfefa"><div class="ttname"><a href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#aa554429def63077ab7a550c0affbfefa">physics::ground_to_ground_projectile_motion::max_height</a></div><div class="ttdeci">T max_height(T initial_velocity, T angle, double gravity=9.81)</div><div class="ttdoc">Calculate the max height of the projectile.</div><div class="ttdef"><b>Definition</b> <a href="#l00072">ground_to_ground_projectile_motion.cpp:72</a></div></div>
<div class="ttc" id="aground__to__ground__projectile__motion_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition</b> <a href="#l00083">ground_to_ground_projectile_motion.cpp:83</a></div></div>
<div class="ttc" id="aground__to__ground__projectile__motion_8cpp_html_ab00e9785fb2670f7af99d6f3d636f87c"><div class="ttname"><a href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#ab00e9785fb2670f7af99d6f3d636f87c">physics::ground_to_ground_projectile_motion::degrees_to_radians</a></div><div class="ttdeci">double degrees_to_radians(double degrees)</div><div class="ttdoc">Convert radians to degrees.</div><div class="ttdef"><b>Definition</b> <a href="#l00034">ground_to_ground_projectile_motion.cpp:34</a></div></div>
<div class="ttc" id="aground__to__ground__projectile__motion_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../d9/d29/ground__to__ground__projectile__motion_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="#l00138">ground_to_ground_projectile_motion.cpp:138</a></div></div>
<div class="ttc" id="aground__to__ground__projectile__motion_8cpp_html_a10362eb607d7882bac3a0688504b00ff"><div class="ttname"><a href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a10362eb607d7882bac3a0688504b00ff">physics::ground_to_ground_projectile_motion::horizontal_range</a></div><div class="ttdeci">T horizontal_range(T initial_velocity, T angle, T time)</div><div class="ttdoc">Calculate the horizontal distance that the projectile travels.</div><div class="ttdef"><b>Definition</b> <a href="#l00064">ground_to_ground_projectile_motion.cpp:64</a></div></div>
<div class="ttc" id="aground__to__ground__projectile__motion_8cpp_html_a3e96cd0b24e64df01776d556ea569133"><div class="ttname"><a href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a3e96cd0b24e64df01776d556ea569133">physics::ground_to_ground_projectile_motion::max_height</a></div><div class="ttdeci">T max_height(T initial_velocity, T angle, double gravity=GRAVITY)</div><div class="ttdoc">Calculate the max height of the projectile.</div><div class="ttdef"><b>Definition</b> <a href="#l00077">ground_to_ground_projectile_motion.cpp:77</a></div></div>
<div class="ttc" id="aground__to__ground__projectile__motion_8cpp_html_a483740fba6ebcc3cee3199e9b2e60b6b"><div class="ttname"><a href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a483740fba6ebcc3cee3199e9b2e60b6b">physics::ground_to_ground_projectile_motion::time_of_flight</a></div><div class="ttdeci">T time_of_flight(T initial_velocity, T angle, double gravity=GRAVITY)</div><div class="ttdoc">Calculate the time of flight.</div><div class="ttdef"><b>Definition</b> <a href="#l00052">ground_to_ground_projectile_motion.cpp:52</a></div></div>
<div class="ttc" id="aground__to__ground__projectile__motion_8cpp_html_a87aa13746e2b60524e028641493eaf5c"><div class="ttname"><a href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a87aa13746e2b60524e028641493eaf5c">GRAVITY</a></div><div class="ttdeci">constexpr double GRAVITY</div><div class="ttdoc">Standard gravity (m/s^2)</div><div class="ttdef"><b>Definition</b> <a href="#l00023">ground_to_ground_projectile_motion.cpp:23</a></div></div>
<div class="ttc" id="aground__to__ground__projectile__motion_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition</b> <a href="#l00088">ground_to_ground_projectile_motion.cpp:88</a></div></div>
<div class="ttc" id="aground__to__ground__projectile__motion_8cpp_html_ab00e9785fb2670f7af99d6f3d636f87c"><div class="ttname"><a href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html#ab00e9785fb2670f7af99d6f3d636f87c">physics::ground_to_ground_projectile_motion::degrees_to_radians</a></div><div class="ttdeci">double degrees_to_radians(double degrees)</div><div class="ttdoc">Convert radians to degrees.</div><div class="ttdef"><b>Definition</b> <a href="#l00039">ground_to_ground_projectile_motion.cpp:39</a></div></div>
<div class="ttc" id="aground__to__ground__projectile__motion_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../d9/d29/ground__to__ground__projectile__motion_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="#l00143">ground_to_ground_projectile_motion.cpp:143</a></div></div>
<div class="ttc" id="anamespaceground__to__ground__projectile__motion_html"><div class="ttname"><a href="../../d0/d20/namespaceground__to__ground__projectile__motion.html">ground_to_ground_projectile_motion</a></div><div class="ttdoc">Functions for the Ground to ground projectile motion equation.</div></div>
<div class="ttc" id="anamespacephysics_html"><div class="ttname"><a href="../../d5/dd0/namespacephysics.html">physics</a></div><div class="ttdoc">for IO operations</div></div>
</div><!-- fragment --></div><!-- contents -->

View File

@@ -1893,9 +1893,10 @@
<a href="d9/d27/namespacelist__array.html"/>
<a href="d9/d29/ground__to__ground__projectile__motion_8cpp.html"/>
<a href="d9/d29/ground__to__ground__projectile__motion_8cpp.html#a10362eb607d7882bac3a0688504b00ff"/>
<a href="d9/d29/ground__to__ground__projectile__motion_8cpp.html#a3e96cd0b24e64df01776d556ea569133"/>
<a href="d9/d29/ground__to__ground__projectile__motion_8cpp.html#a483740fba6ebcc3cee3199e9b2e60b6b"/>
<a href="d9/d29/ground__to__ground__projectile__motion_8cpp.html#a525335710b53cb064ca56b936120431e"/>
<a href="d9/d29/ground__to__ground__projectile__motion_8cpp.html#a563e066975fed1b84750a0a47c3cbb37"/>
<a href="d9/d29/ground__to__ground__projectile__motion_8cpp.html#aa554429def63077ab7a550c0affbfefa"/>
<a href="d9/d29/ground__to__ground__projectile__motion_8cpp.html#a87aa13746e2b60524e028641493eaf5c"/>
<a href="d9/d29/ground__to__ground__projectile__motion_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"/>
<a href="d9/d29/ground__to__ground__projectile__motion_8cpp.html#ab00e9785fb2670f7af99d6f3d636f87c"/>
<a href="d9/d29/ground__to__ground__projectile__motion_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"/>

View File

@@ -129,6 +129,7 @@ $(function(){initNavTree('globals_g.html','',''); });
<li>get_transpose()&#160;:&#160;<a class="el" href="dc/d38/ordinary__least__squares__regressor_8cpp.html#a21c80569aaffb7bf1657e54fa4b97deb">ordinary_least_squares_regressor.cpp</a></li>
<li>getBalance()&#160;:&#160;<a class="el" href="d8/dee/avltree_8cpp.html#aaa457ffec24c9643f2768e7a65e96546">avltree.cpp</a></li>
<li>getnode()&#160;:&#160;<a class="el" href="d3/dce/linkedlist__implentation__usingarray_8cpp.html#a73e11e0871f56342a30da93b6c93e8be">linkedlist_implentation_usingarray.cpp</a></li>
<li>GRAVITY&#160;:&#160;<a class="el" href="d9/d29/ground__to__ground__projectile__motion_8cpp.html#a87aa13746e2b60524e028641493eaf5c">ground_to_ground_projectile_motion.cpp</a></li>
<li>GREY&#160;:&#160;<a class="el" href="da/d4b/depth__first__search__with__stack_8cpp.html#a43e30173f12330e85cce6239a277527e">depth_first_search_with_stack.cpp</a></li>
</ul>
</div><!-- contents -->

View File

@@ -120,6 +120,7 @@ $(function(){initNavTree('globals_vars.html','',''); });
<li>EPSILON&#160;:&#160;<a class="el" href="de/dd3/newton__raphson__method_8cpp.html#a75f355966e0a97665eaf5a4c79baa7af">newton_raphson_method.cpp</a></li>
<li>factors&#160;:&#160;<a class="el" href="db/d0d/prime__factorization_8cpp.html#acfb0df439a4beae5a34ef131ce737c1b">prime_factorization.cpp</a></li>
<li>fib_b&#160;:&#160;<a class="el" href="d7/d35/matrix__exponentiation_8cpp.html#a35b7c98af53ad2ec18658679ad7d43de">matrix_exponentiation.cpp</a></li>
<li>GRAVITY&#160;:&#160;<a class="el" href="d9/d29/ground__to__ground__projectile__motion_8cpp.html#a87aa13746e2b60524e028641493eaf5c">ground_to_ground_projectile_motion.cpp</a></li>
<li>GREY&#160;:&#160;<a class="el" href="da/d4b/depth__first__search__with__stack_8cpp.html#a43e30173f12330e85cce6239a277527e">depth_first_search_with_stack.cpp</a></li>
<li>hashtab&#160;:&#160;<a class="el" href="d1/df3/hash__search_8cpp.html#af413b1740073db54796642b0ab814d6d">hash_search.cpp</a></li>
<li>INF&#160;:&#160;<a class="el" href="d7/d07/bidirectional__dijkstra_8cpp.html#a330a2b0a904f01802ada1f8f3b28e76c">bidirectional_dijkstra.cpp</a>, <a class="el" href="da/d4b/depth__first__search__with__stack_8cpp.html#a330a2b0a904f01802ada1f8f3b28e76c">depth_first_search_with_stack.cpp</a></li>

View File

@@ -143,12 +143,12 @@ var NAVTREEINDEX =
"d6/dae/classothers_1_1lru__cache_1_1_l_r_u_cache.html#aa24a141455b9fbcbec22392c28d04933",
"d8/d2e/classothers_1_1_cache_1_1_l_r_u_cache.html#ab8b6a6aa95db678596bc2a49e864683e",
"d8/dfd/structoperations__on__datastructures_1_1reverse__binary__tree_1_1_node.html#aeb01a65e51df1e3bc5296cde8477c352",
"da/d16/structoperations__on__datastructures_1_1circular__linked__list_1_1_node.html#a7461292b8b91aed86404d0ab019dfdd1",
"db/d66/struct_item.html",
"da/d16/structoperations__on__datastructures_1_1circular__linked__list_1_1_node.html#a12a06eef5ccaf667f319506eee655d95",
"db/d5b/structdata__structures_1_1stack__using__queue_1_1_stack.html#afdfd2f4418c70b1bda50f2c3e416d80b",
"dc/d53/classtests_1_1_circular_linked_list.html#abde75f6ee432b0378d264da8c7c64db2",
"dd/d47/namespacemath.html#ad09d59850865012a6fd95d89954c82e4",
"de/dcd/kadanes3_8cpp.html#aa8dca7b867074164d5f45b0f3851269d",
"functions.html"
"dd/d47/namespacemath.html#ac5803413618fcfb922cb32c6db0fc864",
"de/dcd/kadanes3_8cpp.html#a338439a04148ae89f695595acfa5c147",
"files.html"
];
var SYNCONMSG = 'click to disable panel synchronization';

View File

@@ -1,5 +1,6 @@
var NAVTREEINDEX10 =
{
"dc/d53/classtests_1_1_circular_linked_list.html#abde75f6ee432b0378d264da8c7c64db2":[8,0,128,0,2],
"dc/d53/classtests_1_1_circular_linked_list.html#abde75f6ee432b0378d264da8c7c64db2":[9,0,21,0,2],
"dc/d53/classtests_1_1_circular_linked_list.html#ac341901e926b3fa3a796c64ca572f592":[8,0,128,0,10],
"dc/d53/classtests_1_1_circular_linked_list.html#ac341901e926b3fa3a796c64ca572f592":[9,0,21,0,10],
@@ -248,6 +249,5 @@ var NAVTREEINDEX10 =
"dd/d47/namespacemath.html#abd8f794b2229b42876169ff841b6e444":[8,0,69,18],
"dd/d47/namespacemath.html#abde24398be43538c62e4a496968e60ca":[8,0,69,13],
"dd/d47/namespacemath.html#abf7f2a6d91f1ca6c89698792aea3f188":[8,0,69,2],
"dd/d47/namespacemath.html#ac37d3ba52eb296597d7a024ba8c4a5a5":[8,0,69,27],
"dd/d47/namespacemath.html#ac5803413618fcfb922cb32c6db0fc864":[8,0,69,11]
"dd/d47/namespacemath.html#ac37d3ba52eb296597d7a024ba8c4a5a5":[8,0,69,27]
};

View File

@@ -1,5 +1,6 @@
var NAVTREEINDEX11 =
{
"dd/d47/namespacemath.html#ac5803413618fcfb922cb32c6db0fc864":[8,0,69,11],
"dd/d47/namespacemath.html#ad09d59850865012a6fd95d89954c82e4":[8,0,69,30],
"dd/d47/namespacemath.html#ad0acf82b7bc920182bf8322d1e103953":[8,0,69,6],
"dd/d47/namespacemath.html#ae1ca505751f5a6d3977b86372cfe75ea":[8,0,69,4],
@@ -248,6 +249,5 @@ var NAVTREEINDEX11 =
"de/dc5/intersection__of__two__arrays_8cpp.html#aa8dca7b867074164d5f45b0f3851269d":[10,0,16,6,5],
"de/dc5/intersection__of__two__arrays_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[10,0,16,6,2],
"de/dc5/intersection__of__two__arrays_8cpp_source.html":[10,0,16,6],
"de/dcd/kadanes3_8cpp.html":[10,0,17,8],
"de/dcd/kadanes3_8cpp.html#a338439a04148ae89f695595acfa5c147":[10,0,17,8,1]
"de/dcd/kadanes3_8cpp.html":[10,0,17,8]
};

View File

@@ -1,5 +1,6 @@
var NAVTREEINDEX12 =
{
"de/dcd/kadanes3_8cpp.html#a338439a04148ae89f695595acfa5c147":[10,0,17,8,1],
"de/dcd/kadanes3_8cpp.html#aa8dca7b867074164d5f45b0f3851269d":[10,0,17,8,2],
"de/dcd/kadanes3_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[10,0,17,8,0],
"de/dcd/kadanes3_8cpp_source.html":[10,0,17,8],
@@ -248,6 +249,5 @@ var NAVTREEINDEX12 =
"dir_ece9b94c107bbaa1dd68197a8c9983b9.html":[10,0,12],
"dir_f1797d0c2a0a12033e7d74efffeb14e1.html":[10,0,4,0],
"dir_f3c4fbc4e901afa0a54d0623c5574aa7.html":[10,0,1],
"examples.html":[11],
"files.html":[10,0]
"examples.html":[11]
};

View File

@@ -1,5 +1,6 @@
var NAVTREEINDEX13 =
{
"files.html":[10,0],
"functions.html":[9,3,0],
"functions.html":[9,3,0,0],
"functions_a.html":[9,3,0,1],

View File

@@ -55,6 +55,7 @@ var NAVTREEINDEX7 =
"d9/d27/namespacelist__array.html":[8,0,64],
"d9/d29/ground__to__ground__projectile__motion_8cpp.html":[10,0,18,0],
"d9/d29/ground__to__ground__projectile__motion_8cpp.html#a525335710b53cb064ca56b936120431e":[10,0,18,0,0],
"d9/d29/ground__to__ground__projectile__motion_8cpp.html#a87aa13746e2b60524e028641493eaf5c":[10,0,18,0,7],
"d9/d29/ground__to__ground__projectile__motion_8cpp.html#aa8dca7b867074164d5f45b0f3851269d":[10,0,18,0,5],
"d9/d29/ground__to__ground__projectile__motion_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[10,0,18,0,3],
"d9/d29/ground__to__ground__projectile__motion_8cpp_source.html":[10,0,18,0],
@@ -248,6 +249,5 @@ var NAVTREEINDEX7 =
"da/d0d/longest__common__string_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4":[10,0,6,14,3],
"da/d0d/longest__common__string_8cpp_source.html":[10,0,6,14],
"da/d16/structoperations__on__datastructures_1_1circular__linked__list_1_1_node.html":[9,0,12,0,1],
"da/d16/structoperations__on__datastructures_1_1circular__linked__list_1_1_node.html#a005dc56b0c58350a13f4796b9b30b6c5":[9,0,12,0,1,0],
"da/d16/structoperations__on__datastructures_1_1circular__linked__list_1_1_node.html#a12a06eef5ccaf667f319506eee655d95":[9,0,12,0,1,1]
"da/d16/structoperations__on__datastructures_1_1circular__linked__list_1_1_node.html#a005dc56b0c58350a13f4796b9b30b6c5":[9,0,12,0,1,0]
};

View File

@@ -1,5 +1,6 @@
var NAVTREEINDEX8 =
{
"da/d16/structoperations__on__datastructures_1_1circular__linked__list_1_1_node.html#a12a06eef5ccaf667f319506eee655d95":[9,0,12,0,1,1],
"da/d16/structoperations__on__datastructures_1_1circular__linked__list_1_1_node.html#a7461292b8b91aed86404d0ab019dfdd1":[9,0,12,0,1,2],
"da/d16/structoperations__on__datastructures_1_1circular__linked__list_1_1_node.html#a7c867b8e1034a6f5da490c8b8c09cb77":[9,0,12,0,1,3],
"da/d18/quadratic__equations__complex__numbers_8cpp.html":[10,0,14,51],
@@ -248,6 +249,5 @@ var NAVTREEINDEX8 =
"db/d5b/structdata__structures_1_1stack__using__queue_1_1_stack.html#abdd461689df4983a3ad3b05d853cf5eb":[9,0,2,4,0,0],
"db/d5b/structdata__structures_1_1stack__using__queue_1_1_stack.html#ac0ddec9ab8f778dad23ec446d7a77b39":[9,0,2,4,0,2],
"db/d5b/structdata__structures_1_1stack__using__queue_1_1_stack.html#acf8ca54d5dd6676f255fff3dedacc7c6":[9,0,2,4,0,6],
"db/d5b/structdata__structures_1_1stack__using__queue_1_1_stack.html#af04a8f3536a52d8c9916086b656eefc2":[9,0,2,4,0,1],
"db/d5b/structdata__structures_1_1stack__using__queue_1_1_stack.html#afdfd2f4418c70b1bda50f2c3e416d80b":[9,0,2,4,0,5]
"db/d5b/structdata__structures_1_1stack__using__queue_1_1_stack.html#af04a8f3536a52d8c9916086b656eefc2":[9,0,2,4,0,1]
};

View File

@@ -1,5 +1,6 @@
var NAVTREEINDEX9 =
{
"db/d5b/structdata__structures_1_1stack__using__queue_1_1_stack.html#afdfd2f4418c70b1bda50f2c3e416d80b":[9,0,2,4,0,5],
"db/d66/struct_item.html":[9,0,40],
"db/d6b/kelvin__to__celsius_8cpp.html":[10,0,17,9],
"db/d6b/kelvin__to__celsius_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e":[10,0,17,9,3],
@@ -248,6 +249,5 @@ var NAVTREEINDEX9 =
"dc/d53/classtests_1_1_circular_linked_list.html#aa704319924f97fedfb41caf193a00888":[8,0,128,0,0],
"dc/d53/classtests_1_1_circular_linked_list.html#aa704319924f97fedfb41caf193a00888":[9,0,21,0,0],
"dc/d53/classtests_1_1_circular_linked_list.html#ab682f854f39582a20c9c4102f0482208":[8,0,128,0,14],
"dc/d53/classtests_1_1_circular_linked_list.html#ab682f854f39582a20c9c4102f0482208":[9,0,21,0,14],
"dc/d53/classtests_1_1_circular_linked_list.html#abde75f6ee432b0378d264da8c7c64db2":[8,0,128,0,2]
"dc/d53/classtests_1_1_circular_linked_list.html#ab682f854f39582a20c9c4102f0482208":[9,0,21,0,14]
};

View File

@@ -35,7 +35,7 @@ var searchData=
['matrix_32',['matrix',['../d1/dbe/lu__decomposition_8h.html#ac029b636b353cefbb18b2fcc71e427e4',1,'lu_decomposition.h']]],
['matrix_5fexponentiation_2ecpp_33',['matrix_exponentiation.cpp',['../d7/d35/matrix__exponentiation_8cpp.html',1,'']]],
['max_34',['MAX',['../df/def/power__for__huge__numbers_8cpp.html#a392fb874e547e582e9c66a08a1f23326',1,'MAX:&#160;power_for_huge_numbers.cpp'],['../dc/dc5/paranthesis__matching_8cpp.html#a392fb874e547e582e9c66a08a1f23326',1,'MAX:&#160;paranthesis_matching.cpp'],['../d1/df3/hash__search_8cpp.html#a392fb874e547e582e9c66a08a1f23326',1,'MAX:&#160;hash_search.cpp'],['../dc/dfe/ternary__search_8cpp.html#a392fb874e547e582e9c66a08a1f23326',1,'MAX:&#160;ternary_search.cpp'],['../d4/d32/fibonacci__fast_8cpp.html#abebd72fcda852381644b55f9316719a0',1,'MAX:&#160;fibonacci_fast.cpp']]],
['max_5fheight_35',['max_height',['../d9/d29/ground__to__ground__projectile__motion_8cpp.html#aa554429def63077ab7a550c0affbfefa',1,'physics::ground_to_ground_projectile_motion']]],
['max_5fheight_35',['max_height',['../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a3e96cd0b24e64df01776d556ea569133',1,'physics::ground_to_ground_projectile_motion']]],
['max_5fiter_36',['MAX_ITER',['../d9/d66/group__machine__learning.html#ga5118e5cbc4f0886e27b3a7a2544dded1',1,'adaline_learning.cpp']]],
['max_5fiterations_37',['MAX_ITERATIONS',['../d7/d6a/bisection__method_8cpp.html#a0a3abbca80bc98e7abcb3ae73abe0f14',1,'MAX_ITERATIONS:&#160;bisection_method.cpp'],['../de/dd3/newton__raphson__method_8cpp.html#a5c5ff05b9f37ae59dad67e1d4f6cd51d',1,'MAX_ITERATIONS:&#160;newton_raphson_method.cpp']]],
['max_5flevel_38',['MAX_LEVEL',['../d5/d3c/namespacedata__structures.html#ac0d7e0be24da9f41bcb19745873c436a',1,'data_structures']]],

View File

@@ -71,7 +71,7 @@ var searchData=
['the_20right_20node_20subtree_68',['Case 1: The given node has the right node/subtree',['../d4/d32/inorder__successor__of__bst_8cpp.html#autotoc_md89',1,'']]],
['the_20root_20node_69',['Method 2: Search from the root node',['../d4/d32/inorder__successor__of__bst_8cpp.html#autotoc_md92',1,'']]],
['time_20complexity_70',['Time Complexity',['../d1/d21/quick__sort_8cpp.html#autotoc_md116',1,'']]],
['time_5fof_5fflight_71',['time_of_flight',['../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a563e066975fed1b84750a0a47c3cbb37',1,'physics::ground_to_ground_projectile_motion']]],
['time_5fof_5fflight_71',['time_of_flight',['../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a483740fba6ebcc3cee3199e9b2e60b6b',1,'physics::ground_to_ground_projectile_motion']]],
['tnode_72',['Tnode',['../d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode.html',1,'operations_on_datastructures::trie_operations']]],
['to_5fstring_73',['to_string',['../d6/d84/classhashing_1_1sha256_1_1_hash.html#a4581f503a263d8e928e5716d54477e08',1,'hashing::sha256::Hash']]],
['todo_20list_74',['Todo List',['../dd/da0/todo.html',1,'']]],

View File

@@ -107,16 +107,17 @@ var searchData=
['graph_5fcoloring_2ecpp_104',['graph_coloring.cpp',['../d3/d40/graph__coloring_8cpp.html',1,'']]],
['graphcoloring_105',['graphColoring',['../d3/d40/graph__coloring_8cpp.html#a40337efc5dad761096489bf2c5b1c80c',1,'backtracking::graph_coloring']]],
['graphics_106',['Graphics',['../d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md55',1,'']]],
['gray_5fcode_107',['gray_code',['../de/d9b/namespacegray__code.html',1,'']]],
['greedy_20algorithms_108',['Greedy Algorithms',['../d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md56',1,'']]],
['greedy_5falgorithms_109',['greedy_algorithms',['../d2/d90/namespacegreedy__algorithms.html',1,'']]],
['greedy_5falgorithms_3a_3adijkstra_110',['dijkstra',['../d2/d2f/namespacegreedy__algorithms_1_1dijkstra.html',1,'greedy_algorithms']]],
['greedy_5falgorithms_3a_3astable_5fmatching_111',['stable_matching',['../dd/d9a/namespacegreedy__algorithms_1_1stable__matching.html',1,'greedy_algorithms']]],
['grey_112',['GREY',['../da/d4b/depth__first__search__with__stack_8cpp.html#a43e30173f12330e85cce6239a277527e',1,'depth_first_search_with_stack.cpp']]],
['ground_5fto_5fground_5fprojectile_5fmotion_113',['ground_to_ground_projectile_motion',['../d0/d20/namespaceground__to__ground__projectile__motion.html',1,'']]],
['ground_5fto_5fground_5fprojectile_5fmotion_2ecpp_114',['ground_to_ground_projectile_motion.cpp',['../d9/d29/ground__to__ground__projectile__motion_8cpp.html',1,'']]],
['guidelines_115',['CONTRIBUTION GUIDELINES',['../d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html',1,'']]],
['guidelines_116',['Guidelines',['../d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md35',1,'Commit Guidelines'],['../d3/dd7/md__c_o_d_e___o_f___c_o_n_d_u_c_t.html#autotoc_md10',1,'Enforcement Guidelines']]],
['guidelines_117',['guidelines',['../d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md33',1,'Directory guidelines'],['../d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md32',1,'File Name guidelines']]],
['guidelines_20for_20reviewers_20and_20maintainers_118',['Guidelines for reviewers and maintainers',['../d7/d1b/md__r_e_v_i_e_w_e_r___c_o_d_e.html',1,'']]]
['gravity_107',['GRAVITY',['../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a87aa13746e2b60524e028641493eaf5c',1,'ground_to_ground_projectile_motion.cpp']]],
['gray_5fcode_108',['gray_code',['../de/d9b/namespacegray__code.html',1,'']]],
['greedy_20algorithms_109',['Greedy Algorithms',['../d5/d88/md__d_i_r_e_c_t_o_r_y.html#autotoc_md56',1,'']]],
['greedy_5falgorithms_110',['greedy_algorithms',['../d2/d90/namespacegreedy__algorithms.html',1,'']]],
['greedy_5falgorithms_3a_3adijkstra_111',['dijkstra',['../d2/d2f/namespacegreedy__algorithms_1_1dijkstra.html',1,'greedy_algorithms']]],
['greedy_5falgorithms_3a_3astable_5fmatching_112',['stable_matching',['../dd/d9a/namespacegreedy__algorithms_1_1stable__matching.html',1,'greedy_algorithms']]],
['grey_113',['GREY',['../da/d4b/depth__first__search__with__stack_8cpp.html#a43e30173f12330e85cce6239a277527e',1,'depth_first_search_with_stack.cpp']]],
['ground_5fto_5fground_5fprojectile_5fmotion_114',['ground_to_ground_projectile_motion',['../d0/d20/namespaceground__to__ground__projectile__motion.html',1,'']]],
['ground_5fto_5fground_5fprojectile_5fmotion_2ecpp_115',['ground_to_ground_projectile_motion.cpp',['../d9/d29/ground__to__ground__projectile__motion_8cpp.html',1,'']]],
['guidelines_116',['CONTRIBUTION GUIDELINES',['../d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html',1,'']]],
['guidelines_117',['Guidelines',['../d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md35',1,'Commit Guidelines'],['../d3/dd7/md__c_o_d_e___o_f___c_o_n_d_u_c_t.html#autotoc_md10',1,'Enforcement Guidelines']]],
['guidelines_118',['guidelines',['../d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md33',1,'Directory guidelines'],['../d6/dcd/md__c_o_n_t_r_i_b_u_t_i_n_g.html#autotoc_md32',1,'File Name guidelines']]],
['guidelines_20for_20reviewers_20and_20maintainers_119',['Guidelines for reviewers and maintainers',['../d7/d1b/md__r_e_v_i_e_w_e_r___c_o_d_e.html',1,'']]]
];

File diff suppressed because one or more lines are too long

View File

@@ -13,7 +13,7 @@ var searchData=
['mat_5fmul_10',['mat_mul',['../d6/d26/classciphers_1_1_hill_cipher.html#ad36cbcc7a458b3f3a2af0c4aa1126590',1,'ciphers::HillCipher::mat_mul()'],['../de/d75/qr__eigen__values_8cpp.html#abb8bf4c55e10685a5eb2ad3797fde1ae',1,'mat_mul():&#160;qr_eigen_values.cpp']]],
['match_11',['match',['../d8/d41/namespacegames_1_1memory__game.html#a370760f2b328ad341bcb77d82fa17b01',1,'games::memory_game']]],
['matrix_12',['Matrix',['../dc/d13/classdivide__and__conquer_1_1strassens__multiplication_1_1_matrix.html#a01f3a05cf5abdc5d63999ef1bf9f9256',1,'divide_and_conquer::strassens_multiplication::Matrix::Matrix(const Integer size)'],['../dc/d13/classdivide__and__conquer_1_1strassens__multiplication_1_1_matrix.html#a4aa49765cce39ce48b9241e993e0cfb9',1,'divide_and_conquer::strassens_multiplication::Matrix::Matrix(const Integer rows, const Integer cols)']]],
['max_5fheight_13',['max_height',['../d9/d29/ground__to__ground__projectile__motion_8cpp.html#aa554429def63077ab7a550c0affbfefa',1,'physics::ground_to_ground_projectile_motion']]],
['max_5fheight_13',['max_height',['../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a3e96cd0b24e64df01776d556ea569133',1,'physics::ground_to_ground_projectile_motion']]],
['max_5fsubarray_5fsum_14',['max_subarray_sum',['../de/dcd/kadanes3_8cpp.html#a338439a04148ae89f695595acfa5c147',1,'kadanes3.cpp']]],
['maxcircularsum_15',['maxCircularSum',['../dd/d24/namespacedynamic__programming.html#a5239174fa0d987f2c67edc1f2af82beb',1,'dynamic_programming']]],
['maxknapsackvalue_16',['maxKnapsackValue',['../db/d16/0__1__knapsack_8cpp.html#a15edf30f336885e5b851f6b7199c6cd1',1,'dynamic_programming::knapsack']]],

View File

@@ -1,5 +1,6 @@
var searchData=
[
['good_5fsuffix_0',['good_suffix',['../dd/d5a/structstrings_1_1boyer__moore_1_1pattern.html#a3d62f615a0171a5d77e7018f704f3a7e',1,'strings::boyer_moore::pattern']]],
['grey_1',['GREY',['../da/d4b/depth__first__search__with__stack_8cpp.html#a43e30173f12330e85cce6239a277527e',1,'depth_first_search_with_stack.cpp']]]
['gravity_1',['GRAVITY',['../d9/d29/ground__to__ground__projectile__motion_8cpp.html#a87aa13746e2b60524e028641493eaf5c',1,'ground_to_ground_projectile_motion.cpp']]],
['grey_2',['GREY',['../da/d4b/depth__first__search__with__stack_8cpp.html#a43e30173f12330e85cce6239a277527e',1,'depth_first_search_with_stack.cpp']]]
];