Spherical.html 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  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" target="_blank" rel="noopener">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">
  30. <strong>radius</strong>
  31. </td>
  32. <td class="description last">
  33. <p>The radius, or the Euclidean distance (straight-line distance) from the point to the origin.</p>
  34. <p>Default is <code>1</code>.</p>
  35. </td>
  36. </tr>
  37. <tr>
  38. <td class="name">
  39. <strong>phi</strong>
  40. </td>
  41. <td class="description last">
  42. <p>The polar angle in radians from the y (up) axis.</p>
  43. <p>Default is <code>0</code>.</p>
  44. </td>
  45. </tr>
  46. <tr>
  47. <td class="name">
  48. <strong>theta</strong>
  49. </td>
  50. <td class="description last">
  51. <p>The equator/azimuthal angle in radians around the y (up) axis.</p>
  52. <p>Default is <code>0</code>.</p>
  53. </td>
  54. </tr>
  55. </tbody>
  56. </table>
  57. </div>
  58. </div>
  59. <h2 class="subsection-title">Properties</h2>
  60. <div class="member">
  61. <h3 class="name" id="phi" translate="no">.<a href="#phi">phi</a><span class="type-signature"> : number</span> </h3>
  62. <div class="description">
  63. <p>The polar angle in radians from the y (up) axis.</p>
  64. <p>Default is <code>0</code>.</p>
  65. </div>
  66. </div>
  67. <div class="member">
  68. <h3 class="name" id="radius" translate="no">.<a href="#radius">radius</a><span class="type-signature"> : number</span> </h3>
  69. <div class="description">
  70. <p>The radius, or the Euclidean distance (straight-line distance) from the point to the origin.</p>
  71. <p>Default is <code>1</code>.</p>
  72. </div>
  73. </div>
  74. <div class="member">
  75. <h3 class="name" id="theta" translate="no">.<a href="#theta">theta</a><span class="type-signature"> : number</span> </h3>
  76. <div class="description">
  77. <p>The equator/azimuthal angle in radians around the y (up) axis.</p>
  78. <p>Default is <code>0</code>.</p>
  79. </div>
  80. </div>
  81. <h2 class="subsection-title">Methods</h2>
  82. <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>
  83. <div class="method">
  84. <div class="description">
  85. <p>Returns a new spherical with copied values from this instance.</p>
  86. </div>
  87. <dl class="details">
  88. <dt class="tag-returns"><strong>Returns:</strong> A clone of this instance.</dt>
  89. </dl>
  90. </div>
  91. <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>
  92. <div class="method">
  93. <div class="description">
  94. <p>Copies the values of the given spherical to this instance.</p>
  95. </div>
  96. <table class="params">
  97. <tbody>
  98. <tr>
  99. <td class="name">
  100. <strong>other</strong>
  101. </td>
  102. <td class="description last">
  103. <p>The spherical to copy.</p>
  104. </td>
  105. </tr>
  106. </tbody>
  107. </table>
  108. <dl class="details">
  109. <dt class="tag-returns"><strong>Returns:</strong> A reference to this spherical.</dt>
  110. </dl>
  111. </div>
  112. <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>
  113. <div class="method">
  114. <div class="description">
  115. <p>Restricts the polar angle [page:.phi phi] to be between <code>0.000001</code> and pi -
  116. <code>0.000001</code>.</p>
  117. </div>
  118. <dl class="details">
  119. <dt class="tag-returns"><strong>Returns:</strong> A reference to this spherical.</dt>
  120. </dl>
  121. </div>
  122. <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>
  123. <div class="method">
  124. <div class="description">
  125. <p>Sets the spherical components by copying the given values.</p>
  126. </div>
  127. <table class="params">
  128. <tbody>
  129. <tr>
  130. <td class="name">
  131. <strong>radius</strong>
  132. </td>
  133. <td class="description last">
  134. <p>The radius.</p>
  135. </td>
  136. </tr>
  137. <tr>
  138. <td class="name">
  139. <strong>phi</strong>
  140. </td>
  141. <td class="description last">
  142. <p>The polar angle.</p>
  143. </td>
  144. </tr>
  145. <tr>
  146. <td class="name">
  147. <strong>theta</strong>
  148. </td>
  149. <td class="description last">
  150. <p>The azimuthal angle.</p>
  151. </td>
  152. </tr>
  153. </tbody>
  154. </table>
  155. <dl class="details">
  156. <dt class="tag-returns"><strong>Returns:</strong> A reference to this spherical.</dt>
  157. </dl>
  158. </div>
  159. <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>
  160. <div class="method">
  161. <div class="description">
  162. <p>Sets the spherical components from the given Cartesian coordinates.</p>
  163. </div>
  164. <table class="params">
  165. <tbody>
  166. <tr>
  167. <td class="name">
  168. <strong>x</strong>
  169. </td>
  170. <td class="description last">
  171. <p>The x value.</p>
  172. </td>
  173. </tr>
  174. <tr>
  175. <td class="name">
  176. <strong>y</strong>
  177. </td>
  178. <td class="description last">
  179. <p>The y value.</p>
  180. </td>
  181. </tr>
  182. <tr>
  183. <td class="name">
  184. <strong>z</strong>
  185. </td>
  186. <td class="description last">
  187. <p>The z value.</p>
  188. </td>
  189. </tr>
  190. </tbody>
  191. </table>
  192. <dl class="details">
  193. <dt class="tag-returns"><strong>Returns:</strong> A reference to this spherical.</dt>
  194. </dl>
  195. </div>
  196. <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>
  197. <div class="method">
  198. <div class="description">
  199. <p>Sets the spherical components from the given vector which is assumed to hold
  200. Cartesian coordinates.</p>
  201. </div>
  202. <table class="params">
  203. <tbody>
  204. <tr>
  205. <td class="name">
  206. <strong>v</strong>
  207. </td>
  208. <td class="description last">
  209. <p>The vector to set.</p>
  210. </td>
  211. </tr>
  212. </tbody>
  213. </table>
  214. <dl class="details">
  215. <dt class="tag-returns"><strong>Returns:</strong> A reference to this spherical.</dt>
  216. </dl>
  217. </div>
  218. <h2 class="subsection-title">Source</h2>
  219. <p>
  220. <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>
  221. </p>
  222. </article>
  223. </section>
  224. <script src="../scripts/linenumber.js"></script>
  225. <script src="../scripts/page.js"></script>
  226. </body>
  227. </html>
粤ICP备19079148号