Files
stk/doc/html/Vector3D_8h-source.html
2013-09-29 23:44:33 +02:00

77 lines
6.8 KiB
HTML

<HTML>
<HEAD>
<TITLE>The Synthesis ToolKit in C++ (STK)</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<img src="princeton.gif"> &nbsp; <img src="ccrma.gif"> &nbsp; <img src="mcgill.gif"><P>
<a class="qindex" href="index.html">Home</a> &nbsp; <a class="qindex" href="information.html">Information</a> &nbsp; <a class="qindex" href="classes.html">Classes</a> &nbsp; <a class="qindex" href="download.html">Download</a> &nbsp; <a class="qindex" href="usage.html">Usage</a> &nbsp; <a class="qindex" href="maillist.html">Mail List</a> &nbsp; <a class="qindex" href="system.html">Requirements</a> &nbsp; <a class="qindex" href="links.html">Links</a> &nbsp; <a class="qindex" href="faq.html">FAQ</a> &nbsp; <a class="qindex" href="tutorial.html">Tutorial</a></CENTER>
<HR>
<!-- Generated by Doxygen 1.5.8 -->
<div class="navpath"><a class="el" href="dir_d499f4756a454d8a02faa5ebe57d576f.html">include</a>
</div>
<div class="contents">
<h1>Vector3D.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef STK_VECTOR3D_H</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define STK_VECTOR3D_H</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include "Stk.h"</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &lt;cmath&gt;</span>
<a name="l00006"></a>00006
<a name="l00007"></a>00007 <span class="keyword">namespace </span>stk {
<a name="l00008"></a>00008
<a name="l00009"></a>00009 <span class="comment">/***************************************************/</span>
<a name="l00017"></a>00017 <span class="comment">/***************************************************/</span>
<a name="l00018"></a>00018
<a name="l00019"></a><a class="code" href="classstk_1_1Vector3D.html">00019</a> <span class="keyword">class </span><a class="code" href="classstk_1_1Vector3D.html" title="STK 3D vector class.">Vector3D</a> : <span class="keyword">public</span> <a class="code" href="classstk_1_1Stk.html" title="STK base class.">Stk</a>
<a name="l00020"></a>00020 {
<a name="l00021"></a>00021
<a name="l00022"></a>00022 <span class="keyword">public</span>:
<a name="l00024"></a><a class="code" href="classstk_1_1Vector3D.html#2e5ae76645aa8a89a8ab0640d3ce5292">00024</a> <a class="code" href="classstk_1_1Vector3D.html#2e5ae76645aa8a89a8ab0640d3ce5292" title="Default constructor taking optional initial X, Y, and Z values.">Vector3D</a>( StkFloat x = 0.0, StkFloat y = 0.0, StkFloat z = 0.0 ) { <a class="code" href="classstk_1_1Vector3D.html#65fd03de6d9d42ea53a6cb8418ee7149" title="Set the X, Y, and Z values simultaniously.">setXYZ</a>( x, y, z ); };
<a name="l00025"></a>00025
<a name="l00027"></a><a class="code" href="classstk_1_1Vector3D.html#e4f7cddc34ed1cf80262ff2d5dad65f4">00027</a> StkFloat <a class="code" href="classstk_1_1Vector3D.html#e4f7cddc34ed1cf80262ff2d5dad65f4" title="Get the current X value.">getX</a>( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> X_; };
<a name="l00028"></a>00028
<a name="l00030"></a><a class="code" href="classstk_1_1Vector3D.html#f83bfbe865d702845e37e14d82f642b6">00030</a> StkFloat <a class="code" href="classstk_1_1Vector3D.html#f83bfbe865d702845e37e14d82f642b6" title="Get the current Y value.">getY</a>( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> Y_; };
<a name="l00031"></a>00031
<a name="l00033"></a><a class="code" href="classstk_1_1Vector3D.html#f1c7389a2b4640cbe594fa33f9e4f805">00033</a> StkFloat <a class="code" href="classstk_1_1Vector3D.html#f1c7389a2b4640cbe594fa33f9e4f805" title="Get the current Z value.">getZ</a>( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> Z_; };
<a name="l00034"></a>00034
<a name="l00036"></a>00036 StkFloat <a class="code" href="classstk_1_1Vector3D.html#61b078f252c597feff6d98a5646b03fd" title="Calculate the vector length.">getLength</a>( <span class="keywordtype">void</span> );
<a name="l00037"></a>00037
<a name="l00039"></a><a class="code" href="classstk_1_1Vector3D.html#65fd03de6d9d42ea53a6cb8418ee7149">00039</a> <span class="keywordtype">void</span> <a class="code" href="classstk_1_1Vector3D.html#65fd03de6d9d42ea53a6cb8418ee7149" title="Set the X, Y, and Z values simultaniously.">setXYZ</a>( StkFloat x, StkFloat y, StkFloat z ) { X_ = x; Y_ = y; Z_ = z; };
<a name="l00040"></a>00040
<a name="l00042"></a><a class="code" href="classstk_1_1Vector3D.html#9825ba3adb8fb272d2e3ca20740a48c5">00042</a> <span class="keywordtype">void</span> <a class="code" href="classstk_1_1Vector3D.html#9825ba3adb8fb272d2e3ca20740a48c5" title="Set the X value.">setX</a>( StkFloat x ) { X_ = x; };
<a name="l00043"></a>00043
<a name="l00045"></a><a class="code" href="classstk_1_1Vector3D.html#94de5326b083c6cf72f509aa0fc532f3">00045</a> <span class="keywordtype">void</span> <a class="code" href="classstk_1_1Vector3D.html#94de5326b083c6cf72f509aa0fc532f3" title="Set the Y value.">setY</a>( StkFloat y ) { Y_ = y; };
<a name="l00046"></a>00046
<a name="l00048"></a><a class="code" href="classstk_1_1Vector3D.html#826f2aa5e7b95a0d91f9432f26bec881">00048</a> <span class="keywordtype">void</span> <a class="code" href="classstk_1_1Vector3D.html#826f2aa5e7b95a0d91f9432f26bec881" title="Set the Z value.">setZ</a>( StkFloat z ) { Z_ = z; };
<a name="l00049"></a>00049
<a name="l00050"></a>00050 <span class="keyword">protected</span>:
<a name="l00051"></a>00051 StkFloat X_;
<a name="l00052"></a>00052 StkFloat Y_;
<a name="l00053"></a>00053 StkFloat Z_;
<a name="l00054"></a>00054 };
<a name="l00055"></a>00055
<a name="l00056"></a><a class="code" href="classstk_1_1Vector3D.html#61b078f252c597feff6d98a5646b03fd">00056</a> <span class="keyword">inline</span> StkFloat <a class="code" href="classstk_1_1Vector3D.html#61b078f252c597feff6d98a5646b03fd" title="Calculate the vector length.">Vector3D :: getLength</a>( <span class="keywordtype">void</span> )
<a name="l00057"></a>00057 {
<a name="l00058"></a>00058 StkFloat temp;
<a name="l00059"></a>00059 temp = X_ * X_;
<a name="l00060"></a>00060 temp += Y_ * Y_;
<a name="l00061"></a>00061 temp += Z_ * Z_;
<a name="l00062"></a>00062 temp = sqrt( temp );
<a name="l00063"></a>00063 <span class="keywordflow">return</span> temp;
<a name="l00064"></a>00064 }
<a name="l00065"></a>00065
<a name="l00066"></a>00066 } <span class="comment">// stk namespace</span>
<a name="l00067"></a>00067
<a name="l00068"></a>00068 <span class="preprocessor">#endif</span>
</pre></div></div>
<HR>
<table>
<tr><td><A HREF="http://ccrma.stanford.edu/software/stk/"><I>The Synthesis ToolKit in C++ (STK)</I></A></td></tr>
<tr><td>&copy;1995-2009 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
</table>
</BODY>
</HTML>