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 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
|
<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: <a rel="next" accesskey="n" href="Mathematical-Constants.html#Mathematical-Constants">Mathematical Constants</a>,
Previous: <a rel="previous" accesskey="p" href="Rational-Approximations.html#Rational-Approximations">Rational Approximations</a>,
Up: <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">
— Function File: [<var>theta</var>, <var>r</var>] = <b>cart2pol</b> (<var>x, y</var>)<var><a name="index-cart2pol-1940"></a></var><br>
— 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>
— Function File: [<var>theta</var>, <var>r</var>] = <b>cart2pol</b> (<var>c</var>)<var><a name="index-cart2pol-1942"></a></var><br>
— 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>
— 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, 0, 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">
— Function File: [<var>x</var>, <var>y</var>] = <b>pol2cart</b> (<var>theta, r</var>)<var><a name="index-pol2cart-1945"></a></var><br>
— 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>
— Function File: [<var>x</var>, <var>y</var>] = <b>pol2cart</b> (<var>p</var>)<var><a name="index-pol2cart-1947"></a></var><br>
— 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>
— 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">
— 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>
— 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>
— 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, 0, 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">
— 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>
— 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>
— 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, 0, 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>
|