Documentation for c26eea874d

This commit is contained in:
realstealthninja
2025-05-19 11:38:33 +00:00
parent c7a9a42397
commit 14583a2f33
2829 changed files with 30266 additions and 21669 deletions

View File

@@ -4,7 +4,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="generator" content="Doxygen 1.13.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>TheAlgorithms/C++: physics/ground_to_ground_projectile_motion.cpp File Reference</title>
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
@@ -60,7 +60,7 @@ window.MathJax = {
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.12.0 -->
<!-- Generated by Doxygen 1.13.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -162,15 +162,15 @@ 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="separator:ab00e9785fb2670f7af99d6f3d636f87c"><td class="memSeparator" colspan="2">&#160;</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" id="r_a563e066975fed1b84750a0a47c3cbb37"><td class="memTemplParams" colspan="2">template&lt;typename T&gt; </td></tr>
<tr class="memitem:a563e066975fed1b84750a0a47c3cbb37"><td class="memTemplItemLeft" align="right" valign="top">T&#160;</td><td class="memTemplItemRight" 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="separator:a563e066975fed1b84750a0a47c3cbb37"><td class="memSeparator" colspan="2">&#160;</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" id="r_a10362eb607d7882bac3a0688504b00ff"><td class="memTemplParams" colspan="2">template&lt;typename T&gt; </td></tr>
<tr class="memitem:a10362eb607d7882bac3a0688504b00ff"><td class="memTemplItemLeft" align="right" valign="top">T&#160;</td><td class="memTemplItemRight" 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="separator:a10362eb607d7882bac3a0688504b00ff"><td class="memSeparator" colspan="2">&#160;</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" id="r_aa554429def63077ab7a550c0affbfefa"><td class="memTemplParams" colspan="2">template&lt;typename T&gt; </td></tr>
<tr class="memitem:aa554429def63077ab7a550c0affbfefa"><td class="memTemplItemLeft" align="right" valign="top">T&#160;</td><td class="memTemplItemRight" 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="separator:aa554429def63077ab7a550c0affbfefa"><td class="memSeparator" colspan="2">&#160;</td></tr>
@@ -245,7 +245,7 @@ Functions</h2></td></tr>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
template&lt;typename T&gt; </div>
<table class="memname">
<tr>
<td class="memname">T physics::ground_to_ground_projectile_motion::horizontal_range </td>
@@ -317,7 +317,7 @@ template&lt;typename T &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
template&lt;typename T&gt; </div>
<table class="memname">
<tr>
<td class="memname">T physics::ground_to_ground_projectile_motion::max_height </td>
@@ -374,7 +374,7 @@ template&lt;typename T &gt; </div>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
@@ -391,7 +391,7 @@ template&lt;typename T &gt; </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(physics::ground_to_ground_projectile_motion::time_of_flight(initial_velocity, angle) * 1000.0) /</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>
@@ -405,7 +405,7 @@ template&lt;typename T &gt; </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(physics::ground_to_ground_projectile_motion::horizontal_range(initial_velocity, angle,</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>
@@ -422,7 +422,7 @@ template&lt;typename T &gt; </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(physics::ground_to_ground_projectile_motion::max_height(initial_velocity, angle) * 1000.0) /</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>
@@ -433,6 +433,9 @@ template&lt;typename T &gt; </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>
</div><!-- fragment -->
</div>
</div>
@@ -442,7 +445,7 @@ template&lt;typename T &gt; </div>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
template&lt;typename T&gt; </div>
<table class="memname">
<tr>
<td class="memname">T physics::ground_to_ground_projectile_motion::time_of_flight </td>
@@ -487,7 +490,7 @@ template&lt;typename T &gt; </div>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_59dc24c326e2a72d1164f014b22de83d.html">physics</a></li><li class="navelem"><a class="el" href="../../d9/d29/ground__to__ground__projectile__motion_8cpp.html">ground_to_ground_projectile_motion.cpp</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
</ul>
</div>
</body>