| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Spherical - Three.js Docs</title>
- <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
- <script src="../scripts/highlight.min.js"></script>
- <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
- <link type="text/css" rel="stylesheet" href="../styles/page.css">
- </head>
- <body>
- <h1 translate="no">Spherical</h1>
- <section>
- <header>
- <div class="class-description"><p>This class can be used to represent points in 3D space as
- <a href="https://en.wikipedia.org/wiki/Spherical_coordinate_system" target="_blank" rel="noopener">Spherical coordinates</a>.</p></div>
- </header>
- <article>
- <div class="container-overview">
- <h2>Constructor</h2>
- <h3 class="name name-method" id="Spherical" translate="no">new <a href="#Spherical">Spherical</a><span class="signature">( radius : <span class="param-type">number</span>, phi : <span class="param-type">number</span>, theta : <span class="param-type">number</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Constructs a new spherical.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>radius</strong>
- </td>
- <td class="description last">
- <p>The radius, or the Euclidean distance (straight-line distance) from the point to the origin.</p>
- <p>Default is <code>1</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>phi</strong>
- </td>
- <td class="description last">
- <p>The polar angle in radians from the y (up) axis.</p>
- <p>Default is <code>0</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>theta</strong>
- </td>
- <td class="description last">
- <p>The equator/azimuthal angle in radians around the y (up) axis.</p>
- <p>Default is <code>0</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <h2 class="subsection-title">Properties</h2>
- <div class="member">
- <h3 class="name" id="phi" translate="no">.<a href="#phi">phi</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>The polar angle in radians from the y (up) axis.</p>
- <p>Default is <code>0</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="radius" translate="no">.<a href="#radius">radius</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>The radius, or the Euclidean distance (straight-line distance) from the point to the origin.</p>
- <p>Default is <code>1</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="theta" translate="no">.<a href="#theta">theta</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>The equator/azimuthal angle in radians around the y (up) axis.</p>
- <p>Default is <code>0</code>.</p>
- </div>
- </div>
- <h2 class="subsection-title">Methods</h2>
- <h3 class="name name-method" id="clone" translate="no">.<a href="#clone">clone</a><span class="signature">()</span><span class="type-signature"> : <a href="Spherical.html">Spherical</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns a new spherical with copied values from this instance.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A clone of this instance.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="copy" translate="no">.<a href="#copy">copy</a><span class="signature">( other : <span class="param-type"><a href="Spherical.html">Spherical</a></span> )</span><span class="type-signature"> : <a href="Spherical.html">Spherical</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Copies the values of the given spherical to this instance.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>other</strong>
- </td>
- <td class="description last">
- <p>The spherical to copy.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this spherical.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="makeSafe" translate="no">.<a href="#makeSafe">makeSafe</a><span class="signature">()</span><span class="type-signature"> : <a href="Spherical.html">Spherical</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Restricts the polar angle [page:.phi phi] to be between <code>0.000001</code> and pi -
- <code>0.000001</code>.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this spherical.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="set" translate="no">.<a href="#set">set</a><span class="signature">( radius : <span class="param-type">number</span>, phi : <span class="param-type">number</span>, theta : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="Spherical.html">Spherical</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Sets the spherical components by copying the given values.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>radius</strong>
- </td>
- <td class="description last">
- <p>The radius.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>phi</strong>
- </td>
- <td class="description last">
- <p>The polar angle.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>theta</strong>
- </td>
- <td class="description last">
- <p>The azimuthal angle.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this spherical.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="setFromCartesianCoords" translate="no">.<a href="#setFromCartesianCoords">setFromCartesianCoords</a><span class="signature">( x : <span class="param-type">number</span>, y : <span class="param-type">number</span>, z : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="Spherical.html">Spherical</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Sets the spherical components from the given Cartesian coordinates.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>x</strong>
- </td>
- <td class="description last">
- <p>The x value.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>y</strong>
- </td>
- <td class="description last">
- <p>The y value.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>z</strong>
- </td>
- <td class="description last">
- <p>The z value.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this spherical.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="setFromVector3" translate="no">.<a href="#setFromVector3">setFromVector3</a><span class="signature">( v : <span class="param-type"><a href="Vector3.html">Vector3</a></span> )</span><span class="type-signature"> : <a href="Spherical.html">Spherical</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Sets the spherical components from the given vector which is assumed to hold
- Cartesian coordinates.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>v</strong>
- </td>
- <td class="description last">
- <p>The vector to set.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this spherical.</dt>
- </dl>
- </div>
- <h2 class="subsection-title">Source</h2>
- <p>
- <a href="https://github.com/mrdoob/three.js/blob/master/src/math/Spherical.js" translate="no" target="_blank" rel="noopener">src/math/Spherical.js</a>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|