]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' |
2 | 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> | |
3 | <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'> | |
4 | <head> | |
5 | <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/> | |
6 | <title>boost/qvm/math.hpp</title> | |
7 | <link href='reno.css' type='text/css' rel='stylesheet'/> | |
8 | </head> | |
9 | <body> | |
10 | <div class="body-0"> | |
11 | <div class="body-1"> | |
12 | <div class="body-2"> | |
13 | <div> | |
14 | <h1>QVM: Quaternions, Vectors, Matrices</h1> | |
15 | </div> | |
16 | <!-- Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc. --> | |
17 | <!-- Distributed under the Boost Software License, Version 1.0. (See accompanying --> | |
18 | <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) --> | |
19 | <div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>boost/qvm/math.hpp</h3> | |
20 | </div> | |
21 | <p>This header introduces in the <i>boost::qvm</i> namespace function template declarations corresponding to the functions defined in the standard C header file <i><math.h></i>, and defines <i>float</i> and <i>double</i> specializations which simply call the appropriate C function.</p> | |
22 | <h3>Synopsis:</h3> | |
23 | <div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink">boost/qvm/math.hpp</span>></p> | |
24 | <pre>#include <math.h> | |
25 | #include <<span class="RenoLink"><a href="boost_qvm_inline_hpp.html">boost/qvm/inline.hpp</a></span>> | |
26 | ||
27 | namespace boost | |
28 | { | |
29 | namespace <span class="RenoLink"><a href="qvm.html">qvm</a></span> | |
30 | { | |
31 | <span class="RenoIncludeSPAN"> template <class T> T acos( T ); | |
32 | template <class T> T asin( T ); | |
33 | template <class T> T atan( T ); | |
34 | template <class T> T atan2( T, T ); | |
35 | template <class T> T cos( T ); | |
36 | template <class T> T sin( T ); | |
37 | template <class T> T tan( T ); | |
38 | template <class T> T cosh( T ); | |
39 | template <class T> T sinh( T ); | |
40 | template <class T> T tanh( T ); | |
41 | template <class T> T exp( T ); | |
42 | template <class T> T log( T ); | |
43 | template <class T> T log10( T ); | |
44 | template <class T> T mod( T , T ); | |
45 | template <class T> T pow( T, T ); | |
46 | template <class T> T sqrt( T ); | |
47 | template <class T> T ceil( T ); | |
48 | template <class T> T abs( T ); | |
49 | template <class T> T floor( T ); | |
50 | template <class T> T mod( T, T ); | |
51 | template <class T> T ldexp( T, int ); | |
52 | template <class T> T sign( T ); | |
53 | ||
54 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> float acos<float>( float x ) { return ::acosf(x); } | |
55 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> float asin<float>( float x ) { return ::asinf(x); } | |
56 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> float atan<float>( float x ) { return ::atanf(x); } | |
57 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> float atan2<float>( float x, float y ) { return ::atan2f(x,y); } | |
58 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> float cos<float>( float x ) { return ::cosf(x); } | |
59 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> float sin<float>( float x ) { return ::sinf(x); } | |
60 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> float tan<float>( float x ) { return ::tanf(x); } | |
61 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> float cosh<float>( float x ) { return ::coshf(x); } | |
62 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> float sinh<float>( float x ) { return ::sinhf(x); } | |
63 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> float tanh<float>( float x ) { return ::tanhf(x); } | |
64 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> float exp<float>( float x ) { return ::expf(x); } | |
65 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> float log<float>( float x ) { return ::logf(x); } | |
66 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> float log10<float>( float x ) { return ::log10f(x); } | |
67 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> float mod<float>( float x, float y ) { return ::fmodf(x,y); } | |
68 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> float pow<float>( float x, float y ) { return ::powf(x,y); } | |
69 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> float sqrt<float>( float x ) { return ::sqrtf(x); } | |
70 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> float ceil<float>( float x ) { return ::ceilf(x); } | |
71 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> float abs<float>( float x ) { return ::fabsf(x); } | |
72 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> float floor<float>( float x ) { return ::floorf(x); } | |
73 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> float ldexp<float>( float x, int y ) { return ::ldexpf(x,y); } | |
74 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> float sign<float>( float x ) { return x<0 ? -1.f : +1.f; } | |
75 | ||
76 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> double acos<double>( double x ) { return ::acos(x); } | |
77 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> double asin<double>( double x ) { return ::asin(x); } | |
78 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> double atan<double>( double x ) { return ::atan(x); } | |
79 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> double atan2<double>( double x, double y ) { return ::atan2(x,y); } | |
80 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> double cos<double>( double x ) { return ::cos(x); } | |
81 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> double sin<double>( double x ) { return ::sin(x); } | |
82 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> double tan<double>( double x ) { return ::tan(x); } | |
83 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> double cosh<double>( double x ) { return ::cosh(x); } | |
84 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> double sinh<double>( double x ) { return ::sinh(x); } | |
85 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> double tanh<double>( double x ) { return ::tanh(x); } | |
86 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> double exp<double>( double x ) { return ::exp(x); } | |
87 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> double log<double>( double x ) { return ::log(x); } | |
88 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> double log10<double>( double x ) { return ::log10(x); } | |
89 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> double mod<double>( double x, double y ) { return ::fmod(x,y); } | |
90 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> double pow<double>( double x, double y ) { return ::pow(x,y); } | |
91 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> double sqrt<double>( double x ) { return ::sqrt(x); } | |
92 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> double ceil<double>( double x ) { return ::ceil(x); } | |
93 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> double abs<double>( double x ) { return ::fabs(x); } | |
94 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> double floor<double>( double x ) { return ::floor(x); } | |
95 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> double ldexp<double>( double x, int y ) { return ::ldexp(x,y); } | |
96 | template <> <span class="RenoLink"><a href="BOOST_QVM_INLINE_TRIVIAL.html">BOOST_QVM_INLINE_TRIVIAL</a></span> double sign<double>( double x ) { return x<0 ? -1.0 : +1.0; }</span> | |
97 | } | |
98 | }</pre> | |
99 | </div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> | |
100 | See also: <span class="RenoPageList"><a href="known_quirks_and_issues.html">Known Quirks and Issues</a></span> | |
101 | </div> | |
102 | <!-- Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc. --> | |
103 | <!-- Distributed under the Boost Software License, Version 1.0. (See accompanying --> | |
104 | <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) --> | |
105 | <div id="footer"> | |
106 | <p> | |
107 | <a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a> | |
108 | <a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a> | |
109 | <small>Copyright (c) 2008-2016 by Emil Dotchevski and Reverge Studios, Inc.<br/> | |
110 | Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small> | |
111 | </p> | |
112 | </div> | |
113 | </div> | |
114 | </div> | |
115 | </div> | |
116 | </body> | |
117 | </html> |