Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > b38d2da330d1936e5ab1307c039c4941 > files > 183

octave-doc-3.6.4-3.mga4.noarch.rpm

<html lang="en">
<head>
<title>Coordinate Transformations - GNU Octave</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="GNU Octave">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Arithmetic.html#Arithmetic" title="Arithmetic">
<link rel="prev" href="Rational-Approximations.html#Rational-Approximations" title="Rational Approximations">
<link rel="next" href="Mathematical-Constants.html#Mathematical-Constants" title="Mathematical Constants">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc    { font-variant:small-caps }
  span.roman { font-family:serif; font-weight:normal; } 
  span.sansserif { font-family:sans-serif; font-weight:normal; } 
--></style>
</head>
<body>
<div class="node">
<a name="Coordinate-Transformations"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Mathematical-Constants.html#Mathematical-Constants">Mathematical Constants</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Rational-Approximations.html#Rational-Approximations">Rational Approximations</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Arithmetic.html#Arithmetic">Arithmetic</a>
<hr>
</div>

<h3 class="section">17.8 Coordinate Transformations</h3>

<!-- cart2pol scripts/general/cart2pol.m -->
<p><a name="doc_002dcart2pol"></a>

<div class="defun">
&mdash; Function File: [<var>theta</var>, <var>r</var>] = <b>cart2pol</b> (<var>x, y</var>)<var><a name="index-cart2pol-1940"></a></var><br>
&mdash; Function File: [<var>theta</var>, <var>r</var>, <var>z</var>] = <b>cart2pol</b> (<var>x, y, z</var>)<var><a name="index-cart2pol-1941"></a></var><br>
&mdash; Function File: [<var>theta</var>, <var>r</var>] = <b>cart2pol</b> (<var>c</var>)<var><a name="index-cart2pol-1942"></a></var><br>
&mdash; Function File: [<var>theta</var>, <var>r</var>, <var>z</var>] = <b>cart2pol</b> (<var>c</var>)<var><a name="index-cart2pol-1943"></a></var><br>
&mdash; Function File: <var>p</var> = <b>cart2pol</b> (<var><small class="dots">...</small></var>)<var><a name="index-cart2pol-1944"></a></var><br>
<blockquote>
        <p>Transform Cartesian to polar or cylindrical coordinates.

        <p><var>theta</var> describes the angle relative to the positive x-axis. 
<var>r</var> is the distance to the z-axis (0,&nbsp;0,&nbsp;z)<!-- /@w -->. 
<var>x</var>, <var>y</var> (and <var>z</var>) must be the same shape, or scalar. 
If called with a single matrix argument then each row of <var>c</var>
represents the Cartesian coordinate (<var>x</var>, <var>y</var> (, <var>z</var>)).

        <p>If only a single return argument is requested then return a matrix
<var>p</var> where each row represents one polar/(cylindrical) coordinate
(<var>theta</var>, <var>phi</var> (, <var>z</var>)). 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002dpol2cart.html#doc_002dpol2cart">pol2cart</a>, <a href="doc_002dcart2sph.html#doc_002dcart2sph">cart2sph</a>, <a href="doc_002dsph2cart.html#doc_002dsph2cart">sph2cart</a>. 
</p></blockquote></div>

<!-- pol2cart scripts/general/pol2cart.m -->
   <p><a name="doc_002dpol2cart"></a>

<div class="defun">
&mdash; Function File: [<var>x</var>, <var>y</var>] = <b>pol2cart</b> (<var>theta, r</var>)<var><a name="index-pol2cart-1945"></a></var><br>
&mdash; Function File: [<var>x</var>, <var>y</var>, <var>z</var>] = <b>pol2cart</b> (<var>theta, r, z</var>)<var><a name="index-pol2cart-1946"></a></var><br>
&mdash; Function File: [<var>x</var>, <var>y</var>] = <b>pol2cart</b> (<var>p</var>)<var><a name="index-pol2cart-1947"></a></var><br>
&mdash; Function File: [<var>x</var>, <var>y</var>, <var>z</var>] = <b>pol2cart</b> (<var>p</var>)<var><a name="index-pol2cart-1948"></a></var><br>
&mdash; Function File: <var>C</var> = <b>pol2cart</b> (<var><small class="dots">...</small></var>)<var><a name="index-pol2cart-1949"></a></var><br>
<blockquote><p>Transform polar or cylindrical to Cartesian coordinates.

        <p><var>theta</var>, <var>r</var>, (and <var>z</var>) must be the same shape, or scalar. 
<var>theta</var> describes the angle relative to the positive x-axis. 
<var>r</var> is the distance to the z-axis (0, 0, z). 
If called with a single matrix argument then each row of <var>p</var>
represents the polar/(cylindrical) coordinate (<var>x</var>, <var>y</var> (, <var>z</var>)).

        <p>If only a single return argument is requested then return a matrix
<var>C</var> where each row represents one Cartesian coordinate
(<var>x</var>, <var>y</var> (, <var>z</var>)). 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002dcart2pol.html#doc_002dcart2pol">cart2pol</a>, <a href="doc_002dsph2cart.html#doc_002dsph2cart">sph2cart</a>, <a href="doc_002dcart2sph.html#doc_002dcart2sph">cart2sph</a>. 
</p></blockquote></div>

<!-- cart2sph scripts/general/cart2sph.m -->
   <p><a name="doc_002dcart2sph"></a>

<div class="defun">
&mdash; Function File: [<var>theta</var>, <var>phi</var>, <var>r</var>] = <b>cart2sph</b> (<var>x, y, z</var>)<var><a name="index-cart2sph-1950"></a></var><br>
&mdash; Function File: [<var>theta</var>, <var>phi</var>, <var>r</var>] = <b>cart2sph</b> (<var>C</var>)<var><a name="index-cart2sph-1951"></a></var><br>
&mdash; Function File: <var>S</var> = <b>cart2sph</b> (<var><small class="dots">...</small></var>)<var><a name="index-cart2sph-1952"></a></var><br>
<blockquote><p>Transform Cartesian to spherical coordinates.

        <p><var>theta</var> describes the angle relative to the positive x-axis. 
<var>phi</var> is the angle relative to the xy-plane. 
<var>r</var> is the distance to the origin (0,&nbsp;0,&nbsp;0)<!-- /@w -->. 
<var>x</var>, <var>y</var>, and <var>z</var> must be the same shape, or scalar. 
If called with a single matrix argument then each row of <var>c</var>
represents the Cartesian coordinate (<var>x</var>, <var>y</var>, <var>z</var>).

        <p>If only a single return argument is requested then return a matrix
<var>s</var> where each row represents one spherical coordinate
(<var>theta</var>, <var>phi</var>, <var>r</var>). 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002dsph2cart.html#doc_002dsph2cart">sph2cart</a>, <a href="doc_002dcart2pol.html#doc_002dcart2pol">cart2pol</a>, <a href="doc_002dpol2cart.html#doc_002dpol2cart">pol2cart</a>. 
</p></blockquote></div>

<!-- sph2cart scripts/general/sph2cart.m -->
   <p><a name="doc_002dsph2cart"></a>

<div class="defun">
&mdash; Function File: [<var>x</var>, <var>y</var>, <var>z</var>] = <b>sph2cart</b> (<var>theta, phi, r</var>)<var><a name="index-sph2cart-1953"></a></var><br>
&mdash; Function File: [<var>x</var>, <var>y</var>, <var>z</var>] = <b>sph2cart</b> (<var>S</var>)<var><a name="index-sph2cart-1954"></a></var><br>
&mdash; Function File: C = <b>sph2cart</b> (<var><small class="dots">...</small></var>)<var><a name="index-sph2cart-1955"></a></var><br>
<blockquote><p>Transform spherical to Cartesian coordinates.

        <p><var>theta</var> describes the angle relative to the positive x-axis. 
<var>phi</var> is the angle relative to the xy-plane. 
<var>r</var> is the distance to the origin (0,&nbsp;0,&nbsp;0)<!-- /@w -->. 
<var>theta</var>, <var>phi</var>, and <var>r</var> must be the same shape, or scalar. 
If called with a single matrix argument then each row of <var>s</var>
represents the spherical coordinate (<var>theta</var>, <var>phi</var>, <var>r</var>).

        <p>If only a single return argument is requested then return a matrix
<var>C</var> where each row represents one Cartesian coordinate
(<var>x</var>, <var>y</var>, <var>z</var>). 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002dcart2sph.html#doc_002dcart2sph">cart2sph</a>, <a href="doc_002dpol2cart.html#doc_002dpol2cart">pol2cart</a>, <a href="doc_002dcart2pol.html#doc_002dcart2pol">cart2pol</a>. 
</p></blockquote></div>

   </body></html>