1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>FreeMat: TUBEPLOT Creates a Tubeplot</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="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</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>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">FreeMat
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li class="current"><a href="pages.html"><span>Related Pages</span></a></li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('handle_tubeplot.html','');});
</script>
<div id="doc-content">
<div class="header">
<div class="headertitle">
<div class="title">TUBEPLOT Creates a Tubeplot </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>Section: <a class="el" href="sec_handle.html">Handle-Based Graphics</a> </p>
<h1><a class="anchor" id="Usage"></a>
Usage</h1>
<p>This <code>tubeplot</code> function is from the tubeplot package written by Anders Sandberg. The simplest syntax for the <code>tubeplot</code> routine is </p>
<pre class="fragment"> tubeplot(x,y,z)
</pre><p> plots the basic tube with radius 1, where <code>x,y,z</code> are vectors that describe the tube. If the radius of the tube is to be varied, use the second form </p>
<pre class="fragment"> tubeplot(x,y,z,r)
</pre><p> which plots the basic tube with variable radius r (either a vector or a scalar value). The third form allows you to specify the coloring using a vector of values: </p>
<pre class="fragment"> tubeplot(x,y,z,r,v)
</pre><p> where the coloring is now dependent on the values in the vector <code>v</code>. If you want to create a tube plot with a greater degree of tangential subdivisions (i.e., the tube is more circular, use the form </p>
<pre class="fragment"> tubeplot(x,y,z,r,v,s)
</pre><p> where <code>s</code> is the number of tangential subdivisions (default is 6) You can also use <code>tubeplot</code> to calculate matrices to feed to <code>mesh</code> and <code>surf</code>. </p>
<pre class="fragment"> [X,Y,Z]=tubeplot(x,y,z)
</pre><p> returns <code>N x 3</code> matrices suitable for mesh or surf.</p>
<p>Note that the tube may pinch at points where the normal and binormal misbehaves. It is suitable for general space curves, not ones that contain straight sections. Normally the tube is calculated using the Frenet frame, making the tube minimally twisted except at inflexion points.</p>
<p>To deal with this problem there is an alternative frame: </p>
<pre class="fragment"> tubeplot(x,y,z,r,v,s,vec)
</pre><p> calculates the tube by setting the normal to the cross product of the tangent and the vector vec. If it is chosen so that it is always far from the tangent vector the frame will not twist unduly. </p>
<h1><a class="anchor" id="Example"></a>
Example</h1>
<p>Here is an example of a <code>tubeplot</code>.</p>
<pre class="fragment">--> t=0:(2*pi/100):(2*pi);
--> x=cos(t*2).*(2+sin(t*3)*.3);
--> y=sin(t*2).*(2+sin(t*3)*.3);
--> z=cos(t*3)*.3;
--> tubeplot(x,y,z,0.14*sin(t*5)+.29,t,10);
</pre><div class="image">
<img src="tubeplot1.png" alt="tubeplot1.png"/>
</div>
<p>Written by Anders Sandberg, <a href="#" onclick="location.href='mai'+'lto:'+'asa'+'@n'+'ada'+'.k'+'th.'+'se'; return false;">asa@n<span style="display: none;">.nosp@m.</span>ada.<span style="display: none;">.nosp@m.</span>kth.s<span style="display: none;">.nosp@m.</span>e</a>, 2005 Website says the package is free for anybody to use. www.nada.kth.se/~asa/Ray/Tubeplot/tubeplot.html </p>
</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="index.html">FreeMat Documentation</a></li><li class="navelem"><a class="el" href="sec_handle.html">Handle-Based Graphics</a></li>
<li class="footer">Generated on Thu Jul 25 2013 18:58:33 for FreeMat by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.1.1 </li>
</ul>
</div>
</body>
</html>
|