2020-08-27 03:28:38 +08:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2022-09-08 08:17:03 +08:00
< html xmlns = "http://www.w3.org/1999/xhtml" lang = "en-US" >
2020-08-27 03:28:38 +08:00
< head >
< meta http-equiv = "Content-Type" content = "text/xhtml;charset=UTF-8" / >
2021-10-26 03:34:27 +08:00
< meta http-equiv = "X-UA-Compatible" content = "IE=11" / >
2023-01-21 05:44:50 +08:00
< meta name = "generator" content = "Doxygen 1.9.6" / >
2020-08-27 03:28:38 +08:00
< meta name = "viewport" content = "width=device-width, initial-scale=1" / >
< title > Algorithms_in_C: geometry/vectors_3d.c File Reference< / title >
< 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 >
< link href = "../../navtree.css" rel = "stylesheet" type = "text/css" / >
< script type = "text/javascript" src = "../../resize.js" > < / script >
< script type = "text/javascript" src = "../../navtreedata.js" > < / script >
< script type = "text/javascript" src = "../../navtree.js" > < / script >
< link href = "../../search/search.css" rel = "stylesheet" type = "text/css" / >
< script type = "text/javascript" src = "../../search/searchdata.js" > < / script >
< script type = "text/javascript" src = "../../search/search.js" > < / script >
< script type = "text/x-mathjax-config" >
2021-10-26 03:34:27 +08:00
MathJax.Hub.Config({
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
jax: ["input/TeX","output/HTML-CSS"],
2020-08-27 03:28:38 +08:00
});
< / 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 >
< link href = "../../doxygen.css" rel = "stylesheet" type = "text/css" / >
< / head >
< body >
< div id = "top" > <!-- do not remove this div, it is closed by doxygen! -->
< div id = "titlearea" >
< table cellspacing = "0" cellpadding = "0" >
< tbody >
2022-01-15 04:11:27 +08:00
< tr id = "projectrow" >
< td id = "projectalign" >
2021-10-26 03:34:27 +08:00
< div id = "projectname" > Algorithms_in_C< span id = "projectnumber" >   1.0.0< / span >
2020-08-27 03:28:38 +08:00
< / div >
< div id = "projectbrief" > Set of algorithms implemented in C.< / div >
< / td >
< / tr >
< / tbody >
< / table >
< / div >
<!-- end header part -->
2023-01-21 05:44:50 +08:00
<!-- Generated by Doxygen 1.9.6 -->
2020-08-27 03:28:38 +08:00
< script type = "text/javascript" >
2021-10-26 03:34:27 +08:00
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699& dn=expat.txt MIT */
2022-09-08 08:17:03 +08:00
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
2020-08-27 03:28:38 +08:00
/* @license-end */
< / script >
< script type = "text/javascript" src = "../../menudata.js" > < / script >
< script type = "text/javascript" src = "../../menu.js" > < / script >
< script type = "text/javascript" >
2021-10-26 03:34:27 +08:00
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699& dn=expat.txt MIT */
2020-08-27 03:28:38 +08:00
$(function() {
initMenu('../../',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
2021-10-26 03:34:27 +08:00
/* @license-end */
< / script >
2020-08-27 03:28:38 +08:00
< div id = "main-nav" > < / div >
< / div > <!-- top -->
< div id = "side-nav" class = "ui-resizable side-nav-resizable" >
< div id = "nav-tree" >
< div id = "nav-tree-contents" >
< div id = "nav-sync" class = "sync" > < / div >
< / div >
< / div >
< div id = "splitbar" style = "-moz-user-select:none;"
class="ui-resizable-handle">
< / div >
< / div >
< script type = "text/javascript" >
2021-10-26 03:34:27 +08:00
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699& dn=expat.txt MIT */
2020-08-27 03:28:38 +08:00
$(document).ready(function(){initNavTree('d5/db8/vectors__3d_8c.html','../../'); initResizable(); });
/* @license-end */
< / script >
< div id = "doc-content" >
<!-- window showing the filter options -->
< div id = "MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
< / div >
<!-- iframe showing the search results (closed by default) -->
< div id = "MSearchResultsWindow" >
2022-09-08 08:17:03 +08:00
< div id = "MSearchResults" >
< div class = "SRPage" >
< div id = "SRIndex" >
< div id = "SRResults" > < / div >
< div class = "SRStatus" id = "Loading" > Loading...< / div >
< div class = "SRStatus" id = "Searching" > Searching...< / div >
< div class = "SRStatus" id = "NoMatches" > No Matches< / div >
< / div >
< / div >
< / div >
2020-08-27 03:28:38 +08:00
< / div >
< div class = "header" >
< div class = "summary" >
< a href = "#func-members" > Functions< / a > < / div >
2021-10-26 03:34:27 +08:00
< div class = "headertitle" > < div class = "title" > vectors_3d.c File Reference< / div > < / div >
2020-08-27 03:28:38 +08:00
< / div > <!-- header -->
< div class = "contents" >
< p > Functions related to 3D vector operations.
< a href = "#details" > More...< / a > < / p >
< div class = "textblock" > < code > #include < stdio.h> < / code > < br / >
< code > #include < math.h> < / code > < br / >
< code > #include < assert.h> < / code > < br / >
< code > #include " < a class = "el" href = "../../d0/dc7/geometry__datatypes_8h_source.html" > geometry_datatypes.h< / a > " < / code > < br / >
< / div > < div class = "textblock" > < div class = "dynheader" >
Include dependency graph for vectors_3d.c:< / div >
< div class = "dyncontent" >
2022-09-08 08:17:03 +08:00
< div class = "center" > < iframe scrolling = "no" frameborder = "0" src = "../../d7/daf/vectors__3d_8c__incl.svg" width = "430" height = "110" > < p > < b > This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.< / b > < / p > < / iframe >
2020-08-27 03:28:38 +08:00
< / div >
< / div >
< / div > < table class = "memberdecls" >
2021-10-26 03:34:27 +08:00
< tr class = "heading" > < td colspan = "2" > < h2 class = "groupheader" > < a id = "func-members" name = "func-members" > < / a >
2020-08-27 03:28:38 +08:00
Functions< / h2 > < / td > < / tr >
< tr class = "memitem:ga97da356cb7d5da73a0ac9bad09a435cc" > < td class = "memItemLeft" align = "right" valign = "top" > < a class = "el" href = "../../de/d7b/group__vec__3d.html#gaf9ee870d4922e488bdd3e7262485c270" > vec_3d< / a >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "../../de/d7b/group__vec__3d.html#ga97da356cb7d5da73a0ac9bad09a435cc" > vector_sub< / a > (const < a class = "el" href = "../../de/d7b/group__vec__3d.html#gaf9ee870d4922e488bdd3e7262485c270" > vec_3d< / a > *a, const < a class = "el" href = "../../de/d7b/group__vec__3d.html#gaf9ee870d4922e488bdd3e7262485c270" > vec_3d< / a > *b)< / td > < / tr >
2023-01-21 05:44:50 +08:00
< tr class = "memdesc:ga97da356cb7d5da73a0ac9bad09a435cc" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Subtract one vector from another. < br / > < / td > < / tr >
2020-08-27 03:28:38 +08:00
< tr class = "separator:ga97da356cb7d5da73a0ac9bad09a435cc" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:gaa6b5ac18429ffb0131dc8593d31c25a4" > < td class = "memItemLeft" align = "right" valign = "top" > < a class = "el" href = "../../de/d7b/group__vec__3d.html#gaf9ee870d4922e488bdd3e7262485c270" > vec_3d< / a >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "../../de/d7b/group__vec__3d.html#gaa6b5ac18429ffb0131dc8593d31c25a4" > vector_add< / a > (const < a class = "el" href = "../../de/d7b/group__vec__3d.html#gaf9ee870d4922e488bdd3e7262485c270" > vec_3d< / a > *a, const < a class = "el" href = "../../de/d7b/group__vec__3d.html#gaf9ee870d4922e488bdd3e7262485c270" > vec_3d< / a > *b)< / td > < / tr >
2023-01-21 05:44:50 +08:00
< tr class = "memdesc:gaa6b5ac18429ffb0131dc8593d31c25a4" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Add one vector to another. < br / > < / td > < / tr >
2020-08-27 03:28:38 +08:00
< tr class = "separator:gaa6b5ac18429ffb0131dc8593d31c25a4" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga243e74d542d0d4d14fa3ae0bc2170d84" > < td class = "memItemLeft" align = "right" valign = "top" > float  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "../../de/d7b/group__vec__3d.html#ga243e74d542d0d4d14fa3ae0bc2170d84" > dot_prod< / a > (const < a class = "el" href = "../../de/d7b/group__vec__3d.html#gaf9ee870d4922e488bdd3e7262485c270" > vec_3d< / a > *a, const < a class = "el" href = "../../de/d7b/group__vec__3d.html#gaf9ee870d4922e488bdd3e7262485c270" > vec_3d< / a > *b)< / td > < / tr >
2023-01-21 05:44:50 +08:00
< tr class = "memdesc:ga243e74d542d0d4d14fa3ae0bc2170d84" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Obtain the dot product of two 3D vectors. < br / > < / td > < / tr >
2020-08-27 03:28:38 +08:00
< tr class = "separator:ga243e74d542d0d4d14fa3ae0bc2170d84" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:gae4a49e6bdf13df949e8b23c7925bb5f5" > < td class = "memItemLeft" align = "right" valign = "top" > < a class = "el" href = "../../de/d7b/group__vec__3d.html#gaf9ee870d4922e488bdd3e7262485c270" > vec_3d< / a >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "../../de/d7b/group__vec__3d.html#gae4a49e6bdf13df949e8b23c7925bb5f5" > vector_prod< / a > (const < a class = "el" href = "../../de/d7b/group__vec__3d.html#gaf9ee870d4922e488bdd3e7262485c270" > vec_3d< / a > *a, const < a class = "el" href = "../../de/d7b/group__vec__3d.html#gaf9ee870d4922e488bdd3e7262485c270" > vec_3d< / a > *b)< / td > < / tr >
2023-01-21 05:44:50 +08:00
< tr class = "memdesc:gae4a49e6bdf13df949e8b23c7925bb5f5" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Compute the vector product of two 3d vectors. < br / > < / td > < / tr >
2020-08-27 03:28:38 +08:00
< tr class = "separator:gae4a49e6bdf13df949e8b23c7925bb5f5" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2021-10-26 03:34:27 +08:00
< tr class = "memitem:gae25e1f2e973933bef65838601e2de0af" > < td class = "memItemLeft" align = "right" valign = "top" > const char *  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "../../de/d7b/group__vec__3d.html#gae25e1f2e973933bef65838601e2de0af" > print_vector< / a > (const < a class = "el" href = "../../de/d7b/group__vec__3d.html#gaf9ee870d4922e488bdd3e7262485c270" > vec_3d< / a > *a, const char *name)< / td > < / tr >
2023-01-21 05:44:50 +08:00
< tr class = "memdesc:gae25e1f2e973933bef65838601e2de0af" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Print formatted vector on stdout. < br / > < / td > < / tr >
2021-10-26 03:34:27 +08:00
< tr class = "separator:gae25e1f2e973933bef65838601e2de0af" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2020-08-27 03:28:38 +08:00
< tr class = "memitem:ga94805165d037d111d7d7c0df99e3a5de" > < td class = "memItemLeft" align = "right" valign = "top" > float  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "../../de/d7b/group__vec__3d.html#ga94805165d037d111d7d7c0df99e3a5de" > vector_norm< / a > (const < a class = "el" href = "../../de/d7b/group__vec__3d.html#gaf9ee870d4922e488bdd3e7262485c270" > vec_3d< / a > *a)< / td > < / tr >
2023-01-21 05:44:50 +08:00
< tr class = "memdesc:ga94805165d037d111d7d7c0df99e3a5de" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Compute the norm a vector. < br / > < / td > < / tr >
2020-08-27 03:28:38 +08:00
< tr class = "separator:ga94805165d037d111d7d7c0df99e3a5de" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga3cdfd8378a0b115563ea6c561bb46b7e" > < td class = "memItemLeft" align = "right" valign = "top" > < a class = "el" href = "../../de/d7b/group__vec__3d.html#gaf9ee870d4922e488bdd3e7262485c270" > vec_3d< / a >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "../../de/d7b/group__vec__3d.html#ga3cdfd8378a0b115563ea6c561bb46b7e" > unit_vec< / a > (const < a class = "el" href = "../../de/d7b/group__vec__3d.html#gaf9ee870d4922e488bdd3e7262485c270" > vec_3d< / a > *a)< / td > < / tr >
2023-01-21 05:44:50 +08:00
< tr class = "memdesc:ga3cdfd8378a0b115563ea6c561bb46b7e" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Obtain unit vector in the same direction as given vector. < br / > < / td > < / tr >
2020-08-27 03:28:38 +08:00
< tr class = "separator:ga3cdfd8378a0b115563ea6c561bb46b7e" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga5082b0720c2cc51ae84bf19bd76dc849" > < td class = "memItemLeft" align = "right" valign = "top" > < a class = "el" href = "../../dd/d7a/group__matrix.html#ga9f844010cb96591fa94c9d533a500ab7" > mat_3x3< / a >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "../../de/d7b/group__vec__3d.html#ga5082b0720c2cc51ae84bf19bd76dc849" > get_cross_matrix< / a > (const < a class = "el" href = "../../de/d7b/group__vec__3d.html#gaf9ee870d4922e488bdd3e7262485c270" > vec_3d< / a > *a)< / td > < / tr >
2023-01-21 05:44:50 +08:00
< tr class = "memdesc:ga5082b0720c2cc51ae84bf19bd76dc849" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > The cross product of vectors can be represented as a matrix multiplication operation. < br / > < / td > < / tr >
2020-08-27 03:28:38 +08:00
< tr class = "separator:ga5082b0720c2cc51ae84bf19bd76dc849" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2021-10-26 03:34:27 +08:00
< tr class = "memitem:ga55be1d766c8a824b35d97e79744834d8" > < td class = "memItemLeft" align = "right" valign = "top" > double  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "../../de/d7b/group__vec__3d.html#ga55be1d766c8a824b35d97e79744834d8" > get_angle< / a > (const < a class = "el" href = "../../de/d7b/group__vec__3d.html#gaf9ee870d4922e488bdd3e7262485c270" > vec_3d< / a > *a, const < a class = "el" href = "../../de/d7b/group__vec__3d.html#gaf9ee870d4922e488bdd3e7262485c270" > vec_3d< / a > *b)< / td > < / tr >
2023-01-21 05:44:50 +08:00
< tr class = "memdesc:ga55be1d766c8a824b35d97e79744834d8" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Obtain the angle between two given vectors. < br / > < / td > < / tr >
2021-10-26 03:34:27 +08:00
< tr class = "separator:ga55be1d766c8a824b35d97e79744834d8" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2020-08-27 03:28:38 +08:00
< tr class = "memitem:aa8dca7b867074164d5f45b0f3851269d" > < td class = "memItemLeft" align = "right" valign = "top" > static void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "../../d5/db8/vectors__3d_8c.html#aa8dca7b867074164d5f45b0f3851269d" > test< / a > ()< / td > < / tr >
2023-01-21 05:44:50 +08:00
< tr class = "memdesc:aa8dca7b867074164d5f45b0f3851269d" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Testing function. < br / > < / td > < / tr >
2020-08-27 03:28:38 +08:00
< tr class = "separator:aa8dca7b867074164d5f45b0f3851269d" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a840291bc02cba5474a4cb46a9b9566fe" > < td class = "memItemLeft" align = "right" valign = "top" > int  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "../../d5/db8/vectors__3d_8c.html#a840291bc02cba5474a4cb46a9b9566fe" > main< / a > (void)< / td > < / tr >
2023-01-21 05:44:50 +08:00
< tr class = "memdesc:a840291bc02cba5474a4cb46a9b9566fe" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Main function. < br / > < / td > < / tr >
2020-08-27 03:28:38 +08:00
< tr class = "separator:a840291bc02cba5474a4cb46a9b9566fe" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< / table >
< a name = "details" id = "details" > < / a > < h2 class = "groupheader" > Detailed Description< / h2 >
2023-01-21 05:44:50 +08:00
< div class = "textblock" > < p > Functions related to 3D vector operations. < / p >
2020-08-27 03:28:38 +08:00
< dl class = "section author" > < dt > Author< / dt > < dd > Krishna Vedala < / dd > < / dl >
< / div > < h2 class = "groupheader" > Function Documentation< / h2 >
2021-10-26 03:34:27 +08:00
< a id = "a840291bc02cba5474a4cb46a9b9566fe" name = "a840291bc02cba5474a4cb46a9b9566fe" > < / a >
2022-09-08 08:17:03 +08:00
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#a840291bc02cba5474a4cb46a9b9566fe" > ◆   < / a > < / span > main()< / h2 >
2020-08-27 03:28:38 +08:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > int main < / td >
< td > (< / td >
< td class = "paramtype" > void  < / td >
< td class = "paramname" > < / td > < td > )< / td >
< td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Main function. < / p >
< dl class = "section return" > < dt > Returns< / dt > < dd > 0 on exit < / dd > < / dl >
2022-01-15 04:11:27 +08:00
< div class = "fragment" > < div class = "line" > < span class = "lineno" > 261< / span > {< / div >
< div class = "line" > < span class = "lineno" > 262< / span > < a class = "code hl_function" href = "../../d5/db8/vectors__3d_8c.html#aa8dca7b867074164d5f45b0f3851269d" > test< / a > ();< / div >
< div class = "line" > < span class = "lineno" > 263< / span > < / div >
< div class = "line" > < span class = "lineno" > 264< / span > < span class = "keywordflow" > return< / span > 0;< / div >
< div class = "line" > < span class = "lineno" > 265< / span > }< / div >
2021-10-26 03:34:27 +08:00
< div class = "ttc" id = "avectors__3d_8c_html_aa8dca7b867074164d5f45b0f3851269d" > < div class = "ttname" > < a href = "../../d5/db8/vectors__3d_8c.html#aa8dca7b867074164d5f45b0f3851269d" > test< / a > < / div > < div class = "ttdeci" > static void test()< / div > < div class = "ttdoc" > Testing function.< / div > < div class = "ttdef" > < b > Definition:< / b > vectors_3d.c:223< / div > < / div >
2020-08-27 03:28:38 +08:00
< / div > <!-- fragment --> < div class = "dynheader" >
Here is the call graph for this function:< / div >
< div class = "dyncontent" >
2022-09-08 08:17:03 +08:00
< div class = "center" > < iframe scrolling = "no" frameborder = "0" src = "../../d5/db8/vectors__3d_8c_a840291bc02cba5474a4cb46a9b9566fe_cgraph.svg" width = "555" height = "166" > < p > < b > This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.< / b > < / p > < / iframe >
2020-08-27 03:28:38 +08:00
< / div >
< / div >
< / div >
< / div >
2021-10-26 03:34:27 +08:00
< a id = "aa8dca7b867074164d5f45b0f3851269d" name = "aa8dca7b867074164d5f45b0f3851269d" > < / a >
2022-09-08 08:17:03 +08:00
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#aa8dca7b867074164d5f45b0f3851269d" > ◆   < / a > < / span > test()< / h2 >
2020-08-27 03:28:38 +08:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "mlabels" >
< tr >
< td class = "mlabels-left" >
< table class = "memname" >
< tr >
< td class = "memname" > static void test < / td >
< td > (< / td >
< td class = "paramtype" > void  < / td >
< td class = "paramname" > < / td > < td > )< / td >
< td > < / td >
< / tr >
< / table >
< / td >
< td class = "mlabels-right" >
< span class = "mlabels" > < span class = "mlabel" > static< / span > < / span > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > Testing function. < / p >
< dl class = "section return" > < dt > Returns< / dt > < dd > < code > void< / code > < / dd > < / dl >
2022-01-15 04:11:27 +08:00
< div class = "fragment" > < div class = "line" > < span class = "lineno" > 224< / span > {< / div >
< div class = "line" > < span class = "lineno" > 225< / span > < a class = "code hl_struct" href = "../../d5/db4/structvec__3d__.html" > vec_3d< / a > a = {1., 2., 3.};< / div >
< div class = "line" > < span class = "lineno" > 226< / span > < a class = "code hl_struct" href = "../../d5/db4/structvec__3d__.html" > vec_3d< / a > b = {1., 1., 1.};< / div >
< div class = "line" > < span class = "lineno" > 227< / span > < span class = "keywordtype" > float< / span > d;< / div >
< div class = "line" > < span class = "lineno" > 228< / span > < / div >
< div class = "line" > < span class = "lineno" > 229< / span > < span class = "comment" > // printf(" %s" , print_vector(& a, " a" ));< / span > < / div >
< div class = "line" > < span class = "lineno" > 230< / span > < span class = "comment" > // printf(" %s" , print_vector(& b, " b" ));< / span > < / div >
< div class = "line" > < span class = "lineno" > 231< / span > < / div >
< div class = "line" > < span class = "lineno" > 232< / span > d = < a class = "code hl_function" href = "../../de/d7b/group__vec__3d.html#ga94805165d037d111d7d7c0df99e3a5de" > vector_norm< / a > (& a);< / div >
< div class = "line" > < span class = "lineno" > 233< / span > < span class = "comment" > // printf(" |a| = %.4g\n" , d);< / span > < / div >
< div class = "line" > < span class = "lineno" > 234< / span > assert(fabsf(d - 3.742f) < 0.01);< / div >
< div class = "line" > < span class = "lineno" > 235< / span > d = < a class = "code hl_function" href = "../../de/d7b/group__vec__3d.html#ga94805165d037d111d7d7c0df99e3a5de" > vector_norm< / a > (& b);< / div >
< div class = "line" > < span class = "lineno" > 236< / span > < span class = "comment" > // printf(" |b| = %.4g\n" , d);< / span > < / div >
< div class = "line" > < span class = "lineno" > 237< / span > assert(fabsf(d - 1.732f) < 0.01);< / div >
< div class = "line" > < span class = "lineno" > 238< / span > < / div >
< div class = "line" > < span class = "lineno" > 239< / span > d = < a class = "code hl_function" href = "../../de/d7b/group__vec__3d.html#ga243e74d542d0d4d14fa3ae0bc2170d84" > dot_prod< / a > (& a, & b);< / div >
< div class = "line" > < span class = "lineno" > 240< / span > < span class = "comment" > // printf(" Dot product: %f\n" , d);< / span > < / div >
< div class = "line" > < span class = "lineno" > 241< / span > assert(fabsf(d - 6.f) < 0.01);< / div >
< div class = "line" > < span class = "lineno" > 242< / span > < / div >
< div class = "line" > < span class = "lineno" > 243< / span > < a class = "code hl_struct" href = "../../d5/db4/structvec__3d__.html" > vec_3d< / a > c = < a class = "code hl_function" href = "../../de/d7b/group__vec__3d.html#gae4a49e6bdf13df949e8b23c7925bb5f5" > vector_prod< / a > (& a, & b);< / div >
< div class = "line" > < span class = "lineno" > 244< / span > < span class = "comment" > // printf(" Vector product " );< / span > < / div >
< div class = "line" > < span class = "lineno" > 245< / span > < span class = "comment" > // printf(" %s" , print_vector(& c, " c" ));< / span > < / div >
< div class = "line" > < span class = "lineno" > 246< / span > assert(fabsf(c.x - (-1.f)) < 0.01);< / div >
< div class = "line" > < span class = "lineno" > 247< / span > assert(fabsf(c.y - (2.f)) < 0.01);< / div >
< div class = "line" > < span class = "lineno" > 248< / span > assert(fabsf(c.z - (-1.f)) < 0.01);< / div >
< div class = "line" > < span class = "lineno" > 249< / span > < / div >
< div class = "line" > < span class = "lineno" > 250< / span > < span class = "keywordtype" > double< / span > alpha = < a class = "code hl_function" href = "../../de/d7b/group__vec__3d.html#ga55be1d766c8a824b35d97e79744834d8" > get_angle< / a > (& a, & b);< / div >
< div class = "line" > < span class = "lineno" > 251< / span > < span class = "comment" > // printf(" The angle is %f\n" , alpha);< / span > < / div >
< div class = "line" > < span class = "lineno" > 252< / span > assert(fabsf(alpha - 0.387597) < 0.01);< / div >
< div class = "line" > < span class = "lineno" > 253< / span > }< / div >
2021-02-06 03:52:57 +08:00
< div class = "ttc" id = "agroup__vec__3d_html_ga243e74d542d0d4d14fa3ae0bc2170d84" > < div class = "ttname" > < a href = "../../de/d7b/group__vec__3d.html#ga243e74d542d0d4d14fa3ae0bc2170d84" > dot_prod< / a > < / div > < div class = "ttdeci" > float dot_prod(const vec_3d *a, const vec_3d *b)< / div > < div class = "ttdoc" > Obtain the dot product of two 3D vectors.< / div > < div class = "ttdef" > < b > Definition:< / b > vectors_3d.c:76< / div > < / div >
2021-10-26 03:34:27 +08:00
< div class = "ttc" id = "agroup__vec__3d_html_ga55be1d766c8a824b35d97e79744834d8" > < div class = "ttname" > < a href = "../../de/d7b/group__vec__3d.html#ga55be1d766c8a824b35d97e79744834d8" > get_angle< / a > < / div > < div class = "ttdeci" > double get_angle(const vec_3d *a, const vec_3d *b)< / div > < div class = "ttdoc" > Obtain the angle between two given vectors.< / div > < div class = "ttdef" > < b > Definition:< / b > vectors_3d.c:202< / div > < / div >
2021-02-06 03:52:57 +08:00
< div class = "ttc" id = "agroup__vec__3d_html_ga94805165d037d111d7d7c0df99e3a5de" > < div class = "ttname" > < a href = "../../de/d7b/group__vec__3d.html#ga94805165d037d111d7d7c0df99e3a5de" > vector_norm< / a > < / div > < div class = "ttdeci" > float vector_norm(const vec_3d *a)< / div > < div class = "ttdoc" > Compute the norm a vector.< / div > < div class = "ttdef" > < b > Definition:< / b > vectors_3d.c:138< / div > < / div >
< div class = "ttc" id = "agroup__vec__3d_html_gae4a49e6bdf13df949e8b23c7925bb5f5" > < div class = "ttname" > < a href = "../../de/d7b/group__vec__3d.html#gae4a49e6bdf13df949e8b23c7925bb5f5" > vector_prod< / a > < / div > < div class = "ttdeci" > vec_3d vector_prod(const vec_3d *a, const vec_3d *b)< / div > < div class = "ttdoc" > Compute the vector product of two 3d vectors.< / div > < div class = "ttdef" > < b > Definition:< / b > vectors_3d.c:105< / div > < / div >
< div class = "ttc" id = "astructvec__3d___html" > < div class = "ttname" > < a href = "../../d5/db4/structvec__3d__.html" > vec_3d_< / a > < / div > < div class = "ttdoc" > 3D vector type< / div > < div class = "ttdef" > < b > Definition:< / b > geometry_datatypes.h:22< / div > < / div >
2020-08-27 03:28:38 +08:00
< / div > <!-- fragment --> < div class = "dynheader" >
Here is the call graph for this function:< / div >
< div class = "dyncontent" >
2022-09-08 08:17:03 +08:00
< div class = "center" > < iframe scrolling = "no" frameborder = "0" src = "../../d5/db8/vectors__3d_8c_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg" width = "456" height = "166" > < p > < b > This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.< / b > < / p > < / iframe >
2020-08-27 03:28:38 +08:00
< / div >
< / div >
< / div >
< / div >
< / div > <!-- contents -->
< / div > <!-- doc - content -->
<!-- start footer part -->
< div id = "nav-path" class = "navpath" > <!-- id is needed for treeview function! -->
< ul >
< li class = "navelem" > < a class = "el" href = "../../dir_e3380d2178455503f266746fb14246a5.html" > geometry< / a > < / li > < li class = "navelem" > < a class = "el" href = "../../d5/db8/vectors__3d_8c.html" > vectors_3d.c< / a > < / li >
2023-01-21 05:44:50 +08:00
< 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.9.6 < / li >
2020-08-27 03:28:38 +08:00
< / ul >
< / div >
< / body >
< / html >