mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-07-11 22:46:11 +08:00
Documentation for 8b1eab204b
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
<!-- HTML header for doxygen 1.12.0-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
||||
<head>
|
||||
@@ -5,10 +6,15 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: others/smallest_circle.cpp File Reference</title>
|
||||
<title>TheAlgorithms/C++: others/smallest_circle.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../jquery.js"></script>
|
||||
<script type="text/javascript" src="../../dynsections.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@xpack-3rd-party/doxygen-awesome-css@2.2.0-1/doxygen-awesome-darkmode-toggle.js"></script>
|
||||
<script type="text/javascript">
|
||||
DoxygenAwesomeDarkModeToggle.init()
|
||||
</script>
|
||||
<script type="text/javascript" src="../../clipboard.js"></script>
|
||||
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../navtreedata.js"></script>
|
||||
@@ -18,14 +24,24 @@
|
||||
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="../../search/search.js"></script>
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
|
||||
jax: ["input/TeX","output/HTML-CSS"],
|
||||
});
|
||||
<script type="text/javascript">
|
||||
window.MathJax = {
|
||||
options: {
|
||||
ignoreHtmlClass: 'tex2jax_ignore',
|
||||
processHtmlClass: 'tex2jax_process'
|
||||
},
|
||||
loader: {
|
||||
load: ['[tex]/ams']
|
||||
},
|
||||
tex: {
|
||||
macros: {},
|
||||
packages: ['base','configmacros','ams']
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML/MathJax.js"></script>
|
||||
<script type="text/javascript" id="MathJax-script" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
|
||||
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../../doxygen-awesome.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
@@ -33,10 +49,11 @@ MathJax.Hub.Config({
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectlogo"><img alt="Logo" src="../../project_logo.png"/></td>
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Algorithms_in_C++<span id="projectnumber"> 1.0.0</span>
|
||||
<div id="projectname">TheAlgorithms/C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Set of algorithms implemented in C++.</div>
|
||||
<div id="projectbrief">All the algorithms implemented in C++</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -121,7 +138,9 @@ Include dependency graph for smallest_circle.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d0/db7/smallest__circle_8cpp__incl.svg" width="244" height="111"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
</div><table class="memberdecls">
|
||||
</div>
|
||||
<p><a href="../../d0/d01/smallest__circle_8cpp_source.html">Go to the source code of this file.</a></p>
|
||||
<table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
|
||||
Classes</h2></td></tr>
|
||||
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d8/dc8/struct_point.html">Point</a></td></tr>
|
||||
@@ -133,9 +152,9 @@ Functions</h2></td></tr>
|
||||
<tr class="separator:a3cbebd6f4d2cdf227663c67fe41ba12a"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a94682a4a70d5906857ca09de5b9fb2cc" id="r_a94682a4a70d5906857ca09de5b9fb2cc"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="#a94682a4a70d5906857ca09de5b9fb2cc">TriangleArea</a> (const <a class="el" href="../../d8/dc8/struct_point.html">Point</a> &A, const <a class="el" href="../../d8/dc8/struct_point.html">Point</a> &B, const <a class="el" href="../../d8/dc8/struct_point.html">Point</a> &C)</td></tr>
|
||||
<tr class="separator:a94682a4a70d5906857ca09de5b9fb2cc"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:aee6d48762c1dfb9f14627927f0c16fad" id="r_aee6d48762c1dfb9f14627927f0c16fad"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#aee6d48762c1dfb9f14627927f0c16fad">PointInCircle</a> (const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< <a class="el" href="../../d8/dc8/struct_point.html">Point</a> > &P, const <a class="el" href="../../d8/dc8/struct_point.html">Point</a> &Center, double R)</td></tr>
|
||||
<tr class="memitem:aee6d48762c1dfb9f14627927f0c16fad" id="r_aee6d48762c1dfb9f14627927f0c16fad"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#aee6d48762c1dfb9f14627927f0c16fad">PointInCircle</a> (const std::vector< <a class="el" href="../../d8/dc8/struct_point.html">Point</a> > &P, const <a class="el" href="../../d8/dc8/struct_point.html">Point</a> &Center, double R)</td></tr>
|
||||
<tr class="separator:aee6d48762c1dfb9f14627927f0c16fad"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a0b0676df8e4da7a08c7ccaecea344903" id="r_a0b0676df8e4da7a08c7ccaecea344903"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="#a0b0676df8e4da7a08c7ccaecea344903">circle</a> (const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< <a class="el" href="../../d8/dc8/struct_point.html">Point</a> > &P)</td></tr>
|
||||
<tr class="memitem:a0b0676df8e4da7a08c7ccaecea344903" id="r_a0b0676df8e4da7a08c7ccaecea344903"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="#a0b0676df8e4da7a08c7ccaecea344903">circle</a> (const std::vector< <a class="el" href="../../d8/dc8/struct_point.html">Point</a> > &P)</td></tr>
|
||||
<tr class="separator:a0b0676df8e4da7a08c7ccaecea344903"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ae1a3968e7947464bee7714f6d43b7002" id="r_ae1a3968e7947464bee7714f6d43b7002"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="#ae1a3968e7947464bee7714f6d43b7002">test</a> ()</td></tr>
|
||||
<tr class="separator:ae1a3968e7947464bee7714f6d43b7002"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
@@ -149,6 +168,8 @@ Functions</h2></td></tr>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p>Get centre and radius of the <a href="https://en.wikipedia.org/wiki/Smallest-circle_problem" target="_blank">smallest circle</a> that circumscribes given set of points. </p>
|
||||
<dl class="section see"><dt>See also</dt><dd><a href="https://www.nayuki.io/page/smallest-enclosing-circle" target="_blank">other implementation</a> </dd></dl>
|
||||
|
||||
<p class="definition">Definition in file <a class="el" href="../../d0/d01/smallest__circle_8cpp_source.html">smallest_circle.cpp</a>.</p>
|
||||
</div><h2 class="groupheader">Function Documentation</h2>
|
||||
<a id="a0b0676df8e4da7a08c7ccaecea344903" name="a0b0676df8e4da7a08c7ccaecea344903"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a0b0676df8e4da7a08c7ccaecea344903">◆ </a></span>circle()</h2>
|
||||
@@ -159,7 +180,7 @@ Functions</h2></td></tr>
|
||||
<tr>
|
||||
<td class="memname">double circle </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype">const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< <a class="el" href="../../d8/dc8/struct_point.html">Point</a> > &</td> <td class="paramname"><span class="paramname"><em>P</em></span></td><td>)</td>
|
||||
<td class="paramtype">const std::vector< <a class="el" href="../../d8/dc8/struct_point.html">Point</a> > &</td> <td class="paramname"><span class="paramname"><em>P</em></span></td><td>)</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -172,6 +193,8 @@ The function returns the radius of the circle and prints the coordinated of the
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>radius of the circle </dd></dl>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d0/d01/smallest__circle_8cpp_source.html#l00087">87</a> of file <a class="el" href="../../d0/d01/smallest__circle_8cpp_source.html">smallest_circle.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 87</span> {</div>
|
||||
<div class="line"><span class="lineno"> 88</span> <span class="keywordtype">double</span> minR = INFINITY;</div>
|
||||
<div class="line"><span class="lineno"> 89</span> <span class="keywordtype">double</span> R;</div>
|
||||
@@ -180,11 +203,11 @@ The function returns the radius of the circle and prints the coordinated of the
|
||||
<div class="line"><span class="lineno"> 92</span> </div>
|
||||
<div class="line"><span class="lineno"> 93</span> <span class="comment">/* This code is invalid and does not give correct result for TEST 3 */</span></div>
|
||||
<div class="line"><span class="lineno"> 94</span> <span class="comment">// for each point in the list</span></div>
|
||||
<div class="line"><span class="lineno"> 95</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i < P.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>() - 2; i++)</div>
|
||||
<div class="line"><span class="lineno"> 95</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i < P.size() - 2; i++)</div>
|
||||
<div class="line"><span class="lineno"> 96</span> <span class="comment">// for every subsequent point in the list</span></div>
|
||||
<div class="line"><span class="lineno"> 97</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> j = i + 1; j < P.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>(); j++)</div>
|
||||
<div class="line"><span class="lineno"> 97</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> j = i + 1; j < P.size(); j++)</div>
|
||||
<div class="line"><span class="lineno"> 98</span> <span class="comment">// for every subsequent point in the list</span></div>
|
||||
<div class="line"><span class="lineno"> 99</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> k = j + 1; <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a> < P.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>(); <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>++) {</div>
|
||||
<div class="line"><span class="lineno"> 99</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> k = j + 1; <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a> < P.size(); <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">k</a>++) {</div>
|
||||
<div class="line"><span class="lineno"> 100</span> <span class="comment">// here, we now have picked three points from the given set of</span></div>
|
||||
<div class="line"><span class="lineno"> 101</span> <span class="comment">// points that we can use</span></div>
|
||||
<div class="line"><span class="lineno"> 102</span> <span class="comment">// viz., P[i], P[j] and P[k]</span></div>
|
||||
@@ -219,9 +242,9 @@ The function returns the radius of the circle and prints the coordinated of the
|
||||
<div class="line"><span class="lineno"> 131</span> }</div>
|
||||
<div class="line"><span class="lineno"> 132</span> </div>
|
||||
<div class="line"><span class="lineno"> 133</span> <span class="comment">// for each point in the list</span></div>
|
||||
<div class="line"><span class="lineno"> 134</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i < P.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>() - 1; i++)</div>
|
||||
<div class="line"><span class="lineno"> 134</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i < P.size() - 1; i++)</div>
|
||||
<div class="line"><span class="lineno"> 135</span> <span class="comment">// for every subsequent point in the list</span></div>
|
||||
<div class="line"><span class="lineno"> 136</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> j = i + 1; j < P.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>(); j++) {</div>
|
||||
<div class="line"><span class="lineno"> 136</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> j = i + 1; j < P.size(); j++) {</div>
|
||||
<div class="line"><span class="lineno"> 137</span> <span class="comment">// check for diameterically opposite points</span></div>
|
||||
<div class="line"><span class="lineno"> 138</span> C.x = (P[i].x + P[j].x) / 2;</div>
|
||||
<div class="line"><span class="lineno"> 139</span> C.<a class="code hl_variable" href="../../d8/dc8/struct_point.html#a2e1b5fb2b2a83571f5c0bc0f66a73cf7">y</a> = (P[i].y + P[j].y) / 2;</div>
|
||||
@@ -234,24 +257,16 @@ The function returns the radius of the circle and prints the coordinated of the
|
||||
<div class="line"><span class="lineno"> 146</span> minC = C;</div>
|
||||
<div class="line"><span class="lineno"> 147</span> }</div>
|
||||
<div class="line"><span class="lineno"> 148</span> }</div>
|
||||
<div class="line"><span class="lineno"> 149</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << minC.x << <span class="stringliteral">" "</span> << minC.<a class="code hl_variable" href="../../d8/dc8/struct_point.html#a2e1b5fb2b2a83571f5c0bc0f66a73cf7">y</a> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 149</span> std::cout << minC.x << <span class="stringliteral">" "</span> << minC.<a class="code hl_variable" href="../../d8/dc8/struct_point.html#a2e1b5fb2b2a83571f5c0bc0f66a73cf7">y</a> << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 150</span> <span class="keywordflow">return</span> minR;</div>
|
||||
<div class="line"><span class="lineno"> 151</span>}</div>
|
||||
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
|
||||
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a1b74d828b33760094906797042b89442"><div class="ttname"><a href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">numerical_methods::simpson_method::k</a></div><div class="ttdeci">double k(double x)</div><div class="ttdoc">Another test function.</div><div class="ttdef"><b>Definition</b> composite_simpson_rule.cpp:117</div></div>
|
||||
<div class="ttc" id="aendl_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a></div><div class="ttdeci">T endl(T... args)</div></div>
|
||||
<div class="ttc" id="asize_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/size.html">std::vector::size</a></div><div class="ttdeci">T size(T... args)</div></div>
|
||||
<div class="ttc" id="asmallest__circle_8cpp_html_a3cbebd6f4d2cdf227663c67fe41ba12a"><div class="ttname"><a href="#a3cbebd6f4d2cdf227663c67fe41ba12a">LenghtLine</a></div><div class="ttdeci">double LenghtLine(const Point &A, const Point &B)</div><div class="ttdef"><b>Definition</b> smallest_circle.cpp:37</div></div>
|
||||
<div class="ttc" id="asmallest__circle_8cpp_html_a94682a4a70d5906857ca09de5b9fb2cc"><div class="ttname"><a href="#a94682a4a70d5906857ca09de5b9fb2cc">TriangleArea</a></div><div class="ttdeci">double TriangleArea(const Point &A, const Point &B, const Point &C)</div><div class="ttdef"><b>Definition</b> smallest_circle.cpp:54</div></div>
|
||||
<div class="ttc" id="asmallest__circle_8cpp_html_aee6d48762c1dfb9f14627927f0c16fad"><div class="ttname"><a href="#aee6d48762c1dfb9f14627927f0c16fad">PointInCircle</a></div><div class="ttdeci">bool PointInCircle(const std::vector< Point > &P, const Point &Center, double R)</div><div class="ttdef"><b>Definition</b> smallest_circle.cpp:72</div></div>
|
||||
<div class="ttc" id="astruct_point_html"><div class="ttname"><a href="../../d8/dc8/struct_point.html">Point</a></div><div class="ttdef"><b>Definition</b> line_segment_intersection.cpp:12</div></div>
|
||||
<div class="ttc" id="astruct_point_html_a2e1b5fb2b2a83571f5c0bc0f66a73cf7"><div class="ttname"><a href="../../d8/dc8/struct_point.html#a2e1b5fb2b2a83571f5c0bc0f66a73cf7">Point::y</a></div><div class="ttdeci">int y</div><div class="ttdoc">Point respect to x coordinate.</div><div class="ttdef"><b>Definition</b> line_segment_intersection.cpp:14</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d0/d01/smallest__circle_8cpp_a0b0676df8e4da7a08c7ccaecea344903_cgraph.svg" width="488" height="216"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
|
||||
<div class="ttc" id="acomposite__simpson__rule_8cpp_html_a1b74d828b33760094906797042b89442"><div class="ttname"><a href="../../d4/d18/composite__simpson__rule_8cpp.html#a1b74d828b33760094906797042b89442">numerical_methods::simpson_method::k</a></div><div class="ttdeci">double k(double x)</div><div class="ttdoc">Another test function.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d18/composite__simpson__rule_8cpp_source.html#l00117">composite_simpson_rule.cpp:117</a></div></div>
|
||||
<div class="ttc" id="asmallest__circle_8cpp_html_a3cbebd6f4d2cdf227663c67fe41ba12a"><div class="ttname"><a href="#a3cbebd6f4d2cdf227663c67fe41ba12a">LenghtLine</a></div><div class="ttdeci">double LenghtLine(const Point &A, const Point &B)</div><div class="ttdef"><b>Definition</b> <a href="../../d0/d01/smallest__circle_8cpp_source.html#l00037">smallest_circle.cpp:37</a></div></div>
|
||||
<div class="ttc" id="asmallest__circle_8cpp_html_a94682a4a70d5906857ca09de5b9fb2cc"><div class="ttname"><a href="#a94682a4a70d5906857ca09de5b9fb2cc">TriangleArea</a></div><div class="ttdeci">double TriangleArea(const Point &A, const Point &B, const Point &C)</div><div class="ttdef"><b>Definition</b> <a href="../../d0/d01/smallest__circle_8cpp_source.html#l00054">smallest_circle.cpp:54</a></div></div>
|
||||
<div class="ttc" id="asmallest__circle_8cpp_html_aee6d48762c1dfb9f14627927f0c16fad"><div class="ttname"><a href="#aee6d48762c1dfb9f14627927f0c16fad">PointInCircle</a></div><div class="ttdeci">bool PointInCircle(const std::vector< Point > &P, const Point &Center, double R)</div><div class="ttdef"><b>Definition</b> <a href="../../d0/d01/smallest__circle_8cpp_source.html#l00072">smallest_circle.cpp:72</a></div></div>
|
||||
<div class="ttc" id="astruct_point_html"><div class="ttname"><a href="../../d8/dc8/struct_point.html">Point</a></div><div class="ttdef"><b>Definition</b> <a href="../../d8/d6c/line__segment__intersection_8cpp_source.html#l00012">line_segment_intersection.cpp:12</a></div></div>
|
||||
<div class="ttc" id="astruct_point_html_a2e1b5fb2b2a83571f5c0bc0f66a73cf7"><div class="ttname"><a href="../../d8/dc8/struct_point.html#a2e1b5fb2b2a83571f5c0bc0f66a73cf7">Point::y</a></div><div class="ttdeci">int y</div><div class="ttdoc">Point respect to x coordinate.</div><div class="ttdef"><b>Definition</b> <a href="../../d8/d6c/line__segment__intersection_8cpp_source.html#l00014">line_segment_intersection.cpp:14</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
<a id="a3cbebd6f4d2cdf227663c67fe41ba12a" name="a3cbebd6f4d2cdf227663c67fe41ba12a"></a>
|
||||
@@ -283,18 +298,14 @@ Here is the call graph for this function:</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>ditance </dd></dl>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d0/d01/smallest__circle_8cpp_source.html#l00037">37</a> of file <a class="el" href="../../d0/d01/smallest__circle_8cpp_source.html">smallest_circle.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 37</span> {</div>
|
||||
<div class="line"><span class="lineno"> 38</span> <span class="keywordtype">double</span> dx = B.x - A.x;</div>
|
||||
<div class="line"><span class="lineno"> 39</span> <span class="keywordtype">double</span> dy = B.<a class="code hl_variable" href="../../d8/dc8/struct_point.html#a2e1b5fb2b2a83571f5c0bc0f66a73cf7">y</a> - A.<a class="code hl_variable" href="../../d8/dc8/struct_point.html#a2e1b5fb2b2a83571f5c0bc0f66a73cf7">y</a>;</div>
|
||||
<div class="line"><span class="lineno"> 40</span> <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html">std::sqrt</a>((dx * dx) + (dy * dy));</div>
|
||||
<div class="line"><span class="lineno"> 40</span> <span class="keywordflow">return</span> std::sqrt((dx * dx) + (dy * dy));</div>
|
||||
<div class="line"><span class="lineno"> 41</span>}</div>
|
||||
<div class="ttc" id="asqrt_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html">std::sqrt</a></div><div class="ttdeci">T sqrt(T... args)</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d0/d01/smallest__circle_8cpp_a3cbebd6f4d2cdf227663c67fe41ba12a_cgraph.svg" width="212" height="36"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
<a id="ae66f6b31b5ad750f1fe042a706a4e3d4" name="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
|
||||
@@ -312,23 +323,20 @@ Here is the call graph for this function:</div>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p>Main program </p>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d0/d01/smallest__circle_8cpp_source.html#l00198">198</a> of file <a class="el" href="../../d0/d01/smallest__circle_8cpp_source.html">smallest_circle.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 198</span> {</div>
|
||||
<div class="line"><span class="lineno"> 199</span> <a class="code hl_function" href="#ae1a3968e7947464bee7714f6d43b7002">test</a>();</div>
|
||||
<div class="line"><span class="lineno"> 200</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 200</span> std::cout << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 201</span> <a class="code hl_function" href="#a0283886819c7c140a023582b7269e2d0">test2</a>();</div>
|
||||
<div class="line"><span class="lineno"> 202</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 202</span> std::cout << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 203</span> <a class="code hl_function" href="#a6d0455dd5c30adda100e95f0423c786e">test3</a>();</div>
|
||||
<div class="line"><span class="lineno"> 204</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 205</span>}</div>
|
||||
<div class="ttc" id="asmallest__circle_8cpp_html_a0283886819c7c140a023582b7269e2d0"><div class="ttname"><a href="#a0283886819c7c140a023582b7269e2d0">test2</a></div><div class="ttdeci">void test2()</div><div class="ttdef"><b>Definition</b> smallest_circle.cpp:173</div></div>
|
||||
<div class="ttc" id="asmallest__circle_8cpp_html_a6d0455dd5c30adda100e95f0423c786e"><div class="ttname"><a href="#a6d0455dd5c30adda100e95f0423c786e">test3</a></div><div class="ttdeci">void test3()</div><div class="ttdef"><b>Definition</b> smallest_circle.cpp:188</div></div>
|
||||
<div class="ttc" id="asmallest__circle_8cpp_html_ae1a3968e7947464bee7714f6d43b7002"><div class="ttname"><a href="#ae1a3968e7947464bee7714f6d43b7002">test</a></div><div class="ttdeci">void test()</div><div class="ttdef"><b>Definition</b> smallest_circle.cpp:158</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><div class="zoom"><iframe scrolling="no" frameborder="0" src="../../d0/d01/smallest__circle_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="100%" height="544"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div></div>
|
||||
</div>
|
||||
|
||||
<div class="ttc" id="asmallest__circle_8cpp_html_a0283886819c7c140a023582b7269e2d0"><div class="ttname"><a href="#a0283886819c7c140a023582b7269e2d0">test2</a></div><div class="ttdeci">void test2()</div><div class="ttdef"><b>Definition</b> <a href="../../d0/d01/smallest__circle_8cpp_source.html#l00173">smallest_circle.cpp:173</a></div></div>
|
||||
<div class="ttc" id="asmallest__circle_8cpp_html_a6d0455dd5c30adda100e95f0423c786e"><div class="ttname"><a href="#a6d0455dd5c30adda100e95f0423c786e">test3</a></div><div class="ttdeci">void test3()</div><div class="ttdef"><b>Definition</b> <a href="../../d0/d01/smallest__circle_8cpp_source.html#l00188">smallest_circle.cpp:188</a></div></div>
|
||||
<div class="ttc" id="asmallest__circle_8cpp_html_ae1a3968e7947464bee7714f6d43b7002"><div class="ttname"><a href="#ae1a3968e7947464bee7714f6d43b7002">test</a></div><div class="ttdeci">void test()</div><div class="ttdef"><b>Definition</b> <a href="../../d0/d01/smallest__circle_8cpp_source.html#l00158">smallest_circle.cpp:158</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
<a id="aee6d48762c1dfb9f14627927f0c16fad" name="aee6d48762c1dfb9f14627927f0c16fad"></a>
|
||||
@@ -340,7 +348,7 @@ Here is the call graph for this function:</div>
|
||||
<tr>
|
||||
<td class="memname">bool PointInCircle </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype">const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< <a class="el" href="../../d8/dc8/struct_point.html">Point</a> > &</td> <td class="paramname"><span class="paramname"><em>P</em></span>, </td>
|
||||
<td class="paramtype">const std::vector< <a class="el" href="../../d8/dc8/struct_point.html">Point</a> > &</td> <td class="paramname"><span class="paramname"><em>P</em></span>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
@@ -365,19 +373,16 @@ Here is the call graph for this function:</div>
|
||||
<dl class="section return"><dt>Returns</dt><dd>True if P lies on or within the circle </dd>
|
||||
<dd>
|
||||
False if P lies outside the circle </dd></dl>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d0/d01/smallest__circle_8cpp_source.html#l00072">72</a> of file <a class="el" href="../../d0/d01/smallest__circle_8cpp_source.html">smallest_circle.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="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i < P.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>(); i++) {</div>
|
||||
<div class="line"><span class="lineno"> 73</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i < P.size(); i++) {</div>
|
||||
<div class="line"><span class="lineno"> 74</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="#a3cbebd6f4d2cdf227663c67fe41ba12a">LenghtLine</a>(P[i], Center) > R)</div>
|
||||
<div class="line"><span class="lineno"> 75</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><span class="lineno"> 76</span> }</div>
|
||||
<div class="line"><span class="lineno"> 77</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><span class="lineno"> 78</span>}</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d0/d01/smallest__circle_8cpp_aee6d48762c1dfb9f14627927f0c16fad_cgraph.svg" width="388" height="86"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
<a id="ae1a3968e7947464bee7714f6d43b7002" name="ae1a3968e7947464bee7714f6d43b7002"></a>
|
||||
@@ -398,24 +403,19 @@ Here is the call graph for this function:</div>
|
||||
Circle with <br />
|
||||
radius 3.318493136080724 <br />
|
||||
centre at (3.0454545454545454, 1.3181818181818181) </p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 158</span> {</div>
|
||||
<div class="line"><span class="lineno"> 159</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<Point></a> Pv;</div>
|
||||
<div class="line"><span class="lineno"> 160</span> Pv.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(<a class="code hl_struct" href="../../d8/dc8/struct_point.html">Point</a>(0, 0));</div>
|
||||
<div class="line"><span class="lineno"> 161</span> Pv.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(<a class="code hl_struct" href="../../d8/dc8/struct_point.html">Point</a>(5, 4));</div>
|
||||
<div class="line"><span class="lineno"> 162</span> Pv.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(<a class="code hl_struct" href="../../d8/dc8/struct_point.html">Point</a>(1, 3));</div>
|
||||
<div class="line"><span class="lineno"> 163</span> Pv.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(<a class="code hl_struct" href="../../d8/dc8/struct_point.html">Point</a>(4, 1));</div>
|
||||
<div class="line"><span class="lineno"> 164</span> Pv.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(<a class="code hl_struct" href="../../d8/dc8/struct_point.html">Point</a>(3, -2));</div>
|
||||
<div class="line"><span class="lineno"> 165</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <a class="code hl_function" href="#a0b0676df8e4da7a08c7ccaecea344903">circle</a>(Pv) << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 166</span>}</div>
|
||||
<div class="ttc" id="apush_back_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">std::vector::push_back</a></div><div class="ttdeci">T push_back(T... args)</div></div>
|
||||
<div class="ttc" id="asmallest__circle_8cpp_html_a0b0676df8e4da7a08c7ccaecea344903"><div class="ttname"><a href="#a0b0676df8e4da7a08c7ccaecea344903">circle</a></div><div class="ttdeci">double circle(const std::vector< Point > &P)</div><div class="ttdef"><b>Definition</b> smallest_circle.cpp:87</div></div>
|
||||
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><div class="zoom"><iframe scrolling="no" frameborder="0" src="../../d0/d01/smallest__circle_8cpp_ae1a3968e7947464bee7714f6d43b7002_cgraph.svg" width="100%" height="464"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div></div>
|
||||
</div>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d0/d01/smallest__circle_8cpp_source.html#l00158">158</a> of file <a class="el" href="../../d0/d01/smallest__circle_8cpp_source.html">smallest_circle.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 158</span> {</div>
|
||||
<div class="line"><span class="lineno"> 159</span> std::vector<Point> Pv;</div>
|
||||
<div class="line"><span class="lineno"> 160</span> Pv.push_back(<a class="code hl_struct" href="../../d8/dc8/struct_point.html">Point</a>(0, 0));</div>
|
||||
<div class="line"><span class="lineno"> 161</span> Pv.push_back(<a class="code hl_struct" href="../../d8/dc8/struct_point.html">Point</a>(5, 4));</div>
|
||||
<div class="line"><span class="lineno"> 162</span> Pv.push_back(<a class="code hl_struct" href="../../d8/dc8/struct_point.html">Point</a>(1, 3));</div>
|
||||
<div class="line"><span class="lineno"> 163</span> Pv.push_back(<a class="code hl_struct" href="../../d8/dc8/struct_point.html">Point</a>(4, 1));</div>
|
||||
<div class="line"><span class="lineno"> 164</span> Pv.push_back(<a class="code hl_struct" href="../../d8/dc8/struct_point.html">Point</a>(3, -2));</div>
|
||||
<div class="line"><span class="lineno"> 165</span> std::cout << <a class="code hl_function" href="#a0b0676df8e4da7a08c7ccaecea344903">circle</a>(Pv) << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 166</span>}</div>
|
||||
<div class="ttc" id="asmallest__circle_8cpp_html_a0b0676df8e4da7a08c7ccaecea344903"><div class="ttname"><a href="#a0b0676df8e4da7a08c7ccaecea344903">circle</a></div><div class="ttdeci">double circle(const std::vector< Point > &P)</div><div class="ttdef"><b>Definition</b> <a href="../../d0/d01/smallest__circle_8cpp_source.html#l00087">smallest_circle.cpp:87</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
<a id="a0283886819c7c140a023582b7269e2d0" name="a0283886819c7c140a023582b7269e2d0"></a>
|
||||
@@ -436,20 +436,17 @@ Here is the call graph for this function:</div>
|
||||
Circle with <br />
|
||||
radius 1.4142135623730951 <br />
|
||||
centre at (1.0, 1.0) </p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 173</span> {</div>
|
||||
<div class="line"><span class="lineno"> 174</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<Point></a> Pv;</div>
|
||||
<div class="line"><span class="lineno"> 175</span> Pv.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(<a class="code hl_struct" href="../../d8/dc8/struct_point.html">Point</a>(0, 0));</div>
|
||||
<div class="line"><span class="lineno"> 176</span> Pv.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(<a class="code hl_struct" href="../../d8/dc8/struct_point.html">Point</a>(0, 2));</div>
|
||||
<div class="line"><span class="lineno"> 177</span> Pv.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(<a class="code hl_struct" href="../../d8/dc8/struct_point.html">Point</a>(2, 2));</div>
|
||||
<div class="line"><span class="lineno"> 178</span> Pv.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(<a class="code hl_struct" href="../../d8/dc8/struct_point.html">Point</a>(2, 0));</div>
|
||||
<div class="line"><span class="lineno"> 179</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <a class="code hl_function" href="#a0b0676df8e4da7a08c7ccaecea344903">circle</a>(Pv) << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 180</span>}</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><div class="zoom"><iframe scrolling="no" frameborder="0" src="../../d0/d01/smallest__circle_8cpp_a0283886819c7c140a023582b7269e2d0_cgraph.svg" width="100%" height="464"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div></div>
|
||||
</div>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d0/d01/smallest__circle_8cpp_source.html#l00173">173</a> of file <a class="el" href="../../d0/d01/smallest__circle_8cpp_source.html">smallest_circle.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 173</span> {</div>
|
||||
<div class="line"><span class="lineno"> 174</span> std::vector<Point> Pv;</div>
|
||||
<div class="line"><span class="lineno"> 175</span> Pv.push_back(<a class="code hl_struct" href="../../d8/dc8/struct_point.html">Point</a>(0, 0));</div>
|
||||
<div class="line"><span class="lineno"> 176</span> Pv.push_back(<a class="code hl_struct" href="../../d8/dc8/struct_point.html">Point</a>(0, 2));</div>
|
||||
<div class="line"><span class="lineno"> 177</span> Pv.push_back(<a class="code hl_struct" href="../../d8/dc8/struct_point.html">Point</a>(2, 2));</div>
|
||||
<div class="line"><span class="lineno"> 178</span> Pv.push_back(<a class="code hl_struct" href="../../d8/dc8/struct_point.html">Point</a>(2, 0));</div>
|
||||
<div class="line"><span class="lineno"> 179</span> std::cout << <a class="code hl_function" href="#a0b0676df8e4da7a08c7ccaecea344903">circle</a>(Pv) << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 180</span>}</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
<a id="a6d0455dd5c30adda100e95f0423c786e" name="a6d0455dd5c30adda100e95f0423c786e"></a>
|
||||
@@ -470,20 +467,17 @@ Here is the call graph for this function:</div>
|
||||
Circle with <br />
|
||||
radius 1.821078397711709 <br />
|
||||
centre at (2.142857142857143, 1.7857142857142856) </p><dl class="todo"><dt><b><a class="el" href="../../dd/da0/todo.html#_todo000010">Todo</a></b></dt><dd>This test fails </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 188</span> {</div>
|
||||
<div class="line"><span class="lineno"> 189</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<Point></a> Pv;</div>
|
||||
<div class="line"><span class="lineno"> 190</span> Pv.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(<a class="code hl_struct" href="../../d8/dc8/struct_point.html">Point</a>(0.5, 1));</div>
|
||||
<div class="line"><span class="lineno"> 191</span> Pv.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(<a class="code hl_struct" href="../../d8/dc8/struct_point.html">Point</a>(3.5, 3));</div>
|
||||
<div class="line"><span class="lineno"> 192</span> Pv.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(<a class="code hl_struct" href="../../d8/dc8/struct_point.html">Point</a>(2.5, 0));</div>
|
||||
<div class="line"><span class="lineno"> 193</span> Pv.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/push_back.html">push_back</a>(<a class="code hl_struct" href="../../d8/dc8/struct_point.html">Point</a>(2, 1.5));</div>
|
||||
<div class="line"><span class="lineno"> 194</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <a class="code hl_function" href="#a0b0676df8e4da7a08c7ccaecea344903">circle</a>(Pv) << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 195</span>}</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><div class="zoom"><iframe scrolling="no" frameborder="0" src="../../d0/d01/smallest__circle_8cpp_a6d0455dd5c30adda100e95f0423c786e_cgraph.svg" width="100%" height="464"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div></div>
|
||||
</div>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d0/d01/smallest__circle_8cpp_source.html#l00188">188</a> of file <a class="el" href="../../d0/d01/smallest__circle_8cpp_source.html">smallest_circle.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 188</span> {</div>
|
||||
<div class="line"><span class="lineno"> 189</span> std::vector<Point> Pv;</div>
|
||||
<div class="line"><span class="lineno"> 190</span> Pv.push_back(<a class="code hl_struct" href="../../d8/dc8/struct_point.html">Point</a>(0.5, 1));</div>
|
||||
<div class="line"><span class="lineno"> 191</span> Pv.push_back(<a class="code hl_struct" href="../../d8/dc8/struct_point.html">Point</a>(3.5, 3));</div>
|
||||
<div class="line"><span class="lineno"> 192</span> Pv.push_back(<a class="code hl_struct" href="../../d8/dc8/struct_point.html">Point</a>(2.5, 0));</div>
|
||||
<div class="line"><span class="lineno"> 193</span> Pv.push_back(<a class="code hl_struct" href="../../d8/dc8/struct_point.html">Point</a>(2, 1.5));</div>
|
||||
<div class="line"><span class="lineno"> 194</span> std::cout << <a class="code hl_function" href="#a0b0676df8e4da7a08c7ccaecea344903">circle</a>(Pv) << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 195</span>}</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
<a id="a94682a4a70d5906857ca09de5b9fb2cc" name="a94682a4a70d5906857ca09de5b9fb2cc"></a>
|
||||
@@ -521,19 +515,16 @@ Here is the call graph for this function:</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>area of triangle </dd></dl>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d0/d01/smallest__circle_8cpp_source.html#l00054">54</a> of file <a class="el" href="../../d0/d01/smallest__circle_8cpp_source.html">smallest_circle.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 54</span> {</div>
|
||||
<div class="line"><span class="lineno"> 55</span> <span class="keywordtype">double</span> a = <a class="code hl_function" href="#a3cbebd6f4d2cdf227663c67fe41ba12a">LenghtLine</a>(A, B);</div>
|
||||
<div class="line"><span class="lineno"> 56</span> <span class="keywordtype">double</span> b = <a class="code hl_function" href="#a3cbebd6f4d2cdf227663c67fe41ba12a">LenghtLine</a>(B, C);</div>
|
||||
<div class="line"><span class="lineno"> 57</span> <span class="keywordtype">double</span> c = <a class="code hl_function" href="#a3cbebd6f4d2cdf227663c67fe41ba12a">LenghtLine</a>(C, A);</div>
|
||||
<div class="line"><span class="lineno"> 58</span> <span class="keywordtype">double</span> p = (a + b + c) / 2;</div>
|
||||
<div class="line"><span class="lineno"> 59</span> <span class="keywordflow">return</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/numeric/math/sqrt.html">std::sqrt</a>(p * (p - a) * (p - b) * (p - c));</div>
|
||||
<div class="line"><span class="lineno"> 59</span> <span class="keywordflow">return</span> std::sqrt(p * (p - a) * (p - b) * (p - c));</div>
|
||||
<div class="line"><span class="lineno"> 60</span>}</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d0/d01/smallest__circle_8cpp_a94682a4a70d5906857ca09de5b9fb2cc_cgraph.svg" width="355" height="62"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- contents -->
|
||||
|
||||
Reference in New Issue
Block a user