Spherical.html 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Spherical - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <h1 translate="no">Spherical</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>This class can be used to represent points in 3D space as
  16. <a href="https://en.wikipedia.org/wiki/Spherical_coordinate_system">Spherical coordinates</a>.</p></div>
  17. </header>
  18. <article>
  19. <div class="container-overview">
  20. <h2>Constructor</h2>
  21. <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>
  22. <div class="method">
  23. <div class="description">
  24. <p>Constructs a new spherical.</p>
  25. </div>
  26. <table class="params">
  27. <tbody>
  28. <tr>
  29. <td class="name"><code>radius</code></td>
  30. <td class="description last"><p>The radius, or the Euclidean distance (straight-line distance) from the point to the origin.<br/>Default is <code>1</code>.</p></td>
  31. </tr>
  32. <tr>
  33. <td class="name"><code>phi</code></td>
  34. <td class="description last"><p>The polar angle in radians from the y (up) axis.<br/>Default is <code>0</code>.</p></td>
  35. </tr>
  36. <tr>
  37. <td class="name"><code>theta</code></td>
  38. <td class="description last"><p>The equator/azimuthal angle in radians around the y (up) axis.<br/>Default is <code>0</code>.</p></td>
  39. </tr>
  40. </tbody>
  41. </table>
  42. </div>
  43. </div>
  44. <h2 class="subsection-title">Properties</h2>
  45. <div class="member">
  46. <h3 class="name" id="phi" translate="no">.<a href="#phi">phi</a><span class="type-signature"> : number</span> </h3>
  47. <div class="description">
  48. <p>The polar angle in radians from the y (up) axis.<br/>Default is <code>0</code>.</p>
  49. </div>
  50. </div>
  51. <div class="member">
  52. <h3 class="name" id="radius" translate="no">.<a href="#radius">radius</a><span class="type-signature"> : number</span> </h3>
  53. <div class="description">
  54. <p>The radius, or the Euclidean distance (straight-line distance) from the point to the origin.<br/>Default is <code>1</code>.</p>
  55. </div>
  56. </div>
  57. <div class="member">
  58. <h3 class="name" id="theta" translate="no">.<a href="#theta">theta</a><span class="type-signature"> : number</span> </h3>
  59. <div class="description">
  60. <p>The equator/azimuthal angle in radians around the y (up) axis.<br/>Default is <code>0</code>.</p>
  61. </div>
  62. </div>
  63. <h2 class="subsection-title">Methods</h2>
  64. <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>
  65. <div class="method">
  66. <div class="description">
  67. <p>Returns a new spherical with copied values from this instance.</p>
  68. </div>
  69. <dl class="details">
  70. <dt class="tag-returns"><strong>Returns:</strong> A clone of this instance.</dt>
  71. </dl>
  72. </div>
  73. <h3 class="name name-method" id="copy" translate="no">.<a href="#copy">copy</a><span class="signature">( other : <span class="param-type">Spherical</span> )</span><span class="type-signature"> : <a href="Spherical.html">Spherical</a></span> </h3>
  74. <div class="method">
  75. <div class="description">
  76. <p>Copies the values of the given spherical to this instance.</p>
  77. </div>
  78. <table class="params">
  79. <tbody>
  80. <tr>
  81. <td class="name"><code>other</code></td>
  82. <td class="description last"><p>The spherical to copy.</p></td>
  83. </tr>
  84. </tbody>
  85. </table>
  86. <dl class="details">
  87. <dt class="tag-returns"><strong>Returns:</strong> A reference to this spherical.</dt>
  88. </dl>
  89. </div>
  90. <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>
  91. <div class="method">
  92. <div class="description">
  93. <p>Restricts the polar angle [page:.phi phi] to be between <code>0.000001</code> and pi -
  94. <code>0.000001</code>.</p>
  95. </div>
  96. <dl class="details">
  97. <dt class="tag-returns"><strong>Returns:</strong> A reference to this spherical.</dt>
  98. </dl>
  99. </div>
  100. <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>
  101. <div class="method">
  102. <div class="description">
  103. <p>Sets the spherical components by copying the given values.</p>
  104. </div>
  105. <table class="params">
  106. <tbody>
  107. <tr>
  108. <td class="name"><code>radius</code></td>
  109. <td class="description last"><p>The radius.</p></td>
  110. </tr>
  111. <tr>
  112. <td class="name"><code>phi</code></td>
  113. <td class="description last"><p>The polar angle.</p></td>
  114. </tr>
  115. <tr>
  116. <td class="name"><code>theta</code></td>
  117. <td class="description last"><p>The azimuthal angle.</p></td>
  118. </tr>
  119. </tbody>
  120. </table>
  121. <dl class="details">
  122. <dt class="tag-returns"><strong>Returns:</strong> A reference to this spherical.</dt>
  123. </dl>
  124. </div>
  125. <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>
  126. <div class="method">
  127. <div class="description">
  128. <p>Sets the spherical components from the given Cartesian coordinates.</p>
  129. </div>
  130. <table class="params">
  131. <tbody>
  132. <tr>
  133. <td class="name"><code>x</code></td>
  134. <td class="description last"><p>The x value.</p></td>
  135. </tr>
  136. <tr>
  137. <td class="name"><code>y</code></td>
  138. <td class="description last"><p>The y value.</p></td>
  139. </tr>
  140. <tr>
  141. <td class="name"><code>z</code></td>
  142. <td class="description last"><p>The z value.</p></td>
  143. </tr>
  144. </tbody>
  145. </table>
  146. <dl class="details">
  147. <dt class="tag-returns"><strong>Returns:</strong> A reference to this spherical.</dt>
  148. </dl>
  149. </div>
  150. <h3 class="name name-method" id="setFromVector3" translate="no">.<a href="#setFromVector3">setFromVector3</a><span class="signature">( v : <span class="param-type">Vector3</span> )</span><span class="type-signature"> : <a href="Spherical.html">Spherical</a></span> </h3>
  151. <div class="method">
  152. <div class="description">
  153. <p>Sets the spherical components from the given vector which is assumed to hold
  154. Cartesian coordinates.</p>
  155. </div>
  156. <table class="params">
  157. <tbody>
  158. <tr>
  159. <td class="name"><code>v</code></td>
  160. <td class="description last"><p>The vector to set.</p></td>
  161. </tr>
  162. </tbody>
  163. </table>
  164. <dl class="details">
  165. <dt class="tag-returns"><strong>Returns:</strong> A reference to this spherical.</dt>
  166. </dl>
  167. </div>
  168. <h2 class="subsection-title">Source</h2>
  169. <p>
  170. <a href="https://github.com/mrdoob/three.js/blob/master/src/math/Spherical.js" target="_blank" rel="noopener" translate="no">src/math/Spherical.js</a>
  171. </p>
  172. </article>
  173. </section>
  174. <script src="../scripts/linenumber.js"></script>
  175. <script src="../scripts/page.js"></script>
  176. </body>
  177. </html>
粤ICP备19079148号