Web UI for ARGUS server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2698 lines
50 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Point</title>
  6. <base target="class-frame">
  7. <link href="../assets/css/docs.css" rel="stylesheet" type="text/css">
  8. <script src="../assets/js/paper.js"></script>
  9. <script src="../assets/js/jquery.js"></script>
  10. <script src="../assets/js/codemirror.js"></script>
  11. <script src="../assets/js/docs.js"></script>
  12. </head>
  13. <body>
  14. <article class="reference">
  15. <div class="reference-class">
  16. <h1>Point</h1>
  17. <p>The Point object represents a point in the two dimensional space of the Paper.js project. It is also used to represent two dimensional vector objects.</p>
  18. <h4>Example:<span class="description">Create a point at x: 10, y: 5</span></h4>
  19. <pre><code>var point = new Point(10, 5);
  20. console.log(point.x); // 10
  21. console.log(point.y); // 5</code></pre>
  22. </div>
  23. <!-- =============================== constructors ========================== -->
  24. <div class="reference-members">
  25. <h2>Constructors</h2>
  26. <div id="point-x-y" class="member">
  27. <div class="member-link">
  28. <a name="point-x-y" href="#point-x-y"><tt><b>Point</b>(x, y)</tt></a>
  29. </div>
  30. <div class="member-description hidden">
  31. <div class="member-text">
  32. <p>Creates a Point object with the given x and y coordinates.</p>
  33. <ul class="member-list">
  34. <h4>Parameters:</h4>
  35. <li>
  36. <tt>x:</tt>
  37. <tt>Number</tt>
  38. &mdash;&nbsp;the x coordinate
  39. </li>
  40. <li>
  41. <tt>y:</tt>
  42. <tt>Number</tt>
  43. &mdash;&nbsp;the y coordinate
  44. </li>
  45. </ul>
  46. <ul class="member-list">
  47. <h4>Returns:</h4>
  48. <li>
  49. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>
  50. </li>
  51. </ul>
  52. <h4>Example:<span class="description">Create a point at x: 10, y: 5</span></h4>
  53. <pre><code>var point = new Point(10, 5);
  54. console.log(point.x); // 10
  55. console.log(point.y); // 5</code></pre>
  56. </div>
  57. </div>
  58. </div>
  59. <div id="point-array" class="member">
  60. <div class="member-link">
  61. <a name="point-array" href="#point-array"><tt><b>Point</b>(array)</tt></a>
  62. </div>
  63. <div class="member-description hidden">
  64. <div class="member-text">
  65. <p>Creates a Point object using the numbers in the given array as coordinates.</p>
  66. <ul class="member-list">
  67. <h4>Parameters:</h4>
  68. <li>
  69. <tt>array:</tt>
  70. <tt>Array</tt>
  71. </li>
  72. </ul>
  73. <ul class="member-list">
  74. <h4>Returns:</h4>
  75. <li>
  76. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>
  77. </li>
  78. </ul>
  79. <h4>Example:<span class="description">Creating a point at x: 10, y: 5 using an array of numbers:</span></h4>
  80. <pre><code>var array = [10, 5];
  81. var point = new Point(array);
  82. console.log(point.x); // 10
  83. console.log(point.y); // 5</code></pre>
  84. <h4>Example:<span class="description">Passing an array to a functionality that expects a point:</span></h4>
  85. <pre><code>// Create a circle shaped path at x: 50, y: 50
  86. // with a radius of 30:
  87. var path = new Path.Circle([50, 50], 30);
  88. path.fillColor = 'red';
  89. // Which is the same as doing:
  90. var path = new Path.Circle(new Point(50, 50), 30);
  91. path.fillColor = 'red';</code></pre>
  92. </div>
  93. </div>
  94. </div>
  95. <div id="point-object" class="member">
  96. <div class="member-link">
  97. <a name="point-object" href="#point-object"><tt><b>Point</b>(object)</tt></a>
  98. </div>
  99. <div class="member-description hidden">
  100. <div class="member-text">
  101. <p>Creates a Point object using the properties in the given object.</p>
  102. <ul class="member-list">
  103. <h4>Parameters:</h4>
  104. <li>
  105. <tt>object:</tt>
  106. <tt>Object</tt>
  107. &mdash;&nbsp;the object describing the point&rsquo;s properties
  108. </li>
  109. </ul>
  110. <ul class="member-list">
  111. <h4>Returns:</h4>
  112. <li>
  113. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>
  114. </li>
  115. </ul>
  116. <h4>Example:<span class="description">Creating a point using an object literal with length and angle properties:</span></h4>
  117. <pre><code>var point = new Point({
  118. length: 10,
  119. angle: 90
  120. });
  121. console.log(point.length); // 10
  122. console.log(point.angle); // 90</code></pre>
  123. <h4>Example:<span class="description">Creating a point at x: 10, y: 20 using an object literal:</span></h4>
  124. <pre><code>var point = new Point({
  125. x: 10,
  126. y: 20
  127. });
  128. console.log(point.x); // 10
  129. console.log(point.y); // 20</code></pre>
  130. <h4>Example:<span class="description">Passing an object to a functionality that expects a point:</span></h4>
  131. <pre><code>var center = {
  132. x: 50,
  133. y: 50
  134. };
  135. // Creates a circle shaped path at x: 50, y: 50
  136. // with a radius of 30:
  137. var path = new Path.Circle(center, 30);
  138. path.fillColor = 'red';</code></pre>
  139. </div>
  140. </div>
  141. </div>
  142. <div id="point-size" class="member">
  143. <div class="member-link">
  144. <a name="point-size" href="#point-size"><tt><b>Point</b>(size)</tt></a>
  145. </div>
  146. <div class="member-description hidden">
  147. <div class="member-text">
  148. <p>Creates a Point object using the width and height values of the given Size object.</p>
  149. <ul class="member-list">
  150. <h4>Parameters:</h4>
  151. <li>
  152. <tt>size:</tt>
  153. <a href="../classes/Size.html"><tt>Size</tt></a>
  154. </li>
  155. </ul>
  156. <ul class="member-list">
  157. <h4>Returns:</h4>
  158. <li>
  159. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>
  160. </li>
  161. </ul>
  162. <h4>Example:<span class="description">Creating a point using a size object.</span></h4>
  163. <pre><code>// Create a Size with a width of 100pt and a height of 50pt
  164. var size = new Size(100, 50);
  165. console.log(size); // { width: 100, height: 50 }
  166. var point = new Point(size);
  167. console.log(point); // { x: 100, y: 50 }</code></pre>
  168. </div>
  169. </div>
  170. </div>
  171. <div id="point-point" class="member">
  172. <div class="member-link">
  173. <a name="point-point" href="#point-point"><tt><b>Point</b>(point)</tt></a>
  174. </div>
  175. <div class="member-description hidden">
  176. <div class="member-text">
  177. <p>Creates a Point object using the coordinates of the given Point object.</p>
  178. <ul class="member-list">
  179. <h4>Parameters:</h4>
  180. <li>
  181. <tt>point:</tt>
  182. <a href="../classes/Point.html"><tt>Point</tt></a>
  183. </li>
  184. </ul>
  185. <ul class="member-list">
  186. <h4>Returns:</h4>
  187. <li>
  188. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>
  189. </li>
  190. </ul>
  191. </div>
  192. </div>
  193. </div>
  194. </div>
  195. <!-- ================================ operators ============================ -->
  196. <div class="reference-members">
  197. <h2>Operators</h2>
  198. <div id="add" class="member">
  199. <div class="member-link">
  200. <a name="add" href="#add"><tt><tt><b>+</b>number</tt>, <tt><b>+</b>point</tt></tt></a>
  201. </div>
  202. <div class="member-description hidden">
  203. <div class="member-text">
  204. <p>Returns the addition of the supplied value to both coordinates of the point as a new point. The object itself is not modified!</p>
  205. <ul class="member-list">
  206. <h4>Parameters:</h4>
  207. <li>
  208. <tt>number:</tt>
  209. <tt>Number</tt>
  210. &mdash;&nbsp;the number to add
  211. </li>
  212. </ul>
  213. <ul class="member-list">
  214. <h4>Returns:</h4>
  215. <li>
  216. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the addition of the point and the value as a new point
  217. </li>
  218. </ul>
  219. <h4>Example:</h4>
  220. <pre><code>var point = new Point(5, 10);
  221. var result = point + 20;
  222. console.log(result); // {x: 25, y: 30}</code></pre>
  223. </div>
  224. <div class="member-text">
  225. <p>Returns the addition of the supplied point to the point as a new point. The object itself is not modified!</p>
  226. <ul class="member-list">
  227. <h4>Parameters:</h4>
  228. <li>
  229. <tt>point:</tt>
  230. <a href="../classes/Point.html"><tt>Point</tt></a>
  231. &mdash;&nbsp;the point to add
  232. </li>
  233. </ul>
  234. <ul class="member-list">
  235. <h4>Returns:</h4>
  236. <li>
  237. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the addition of the two points as a new point
  238. </li>
  239. </ul>
  240. <h4>Example:</h4>
  241. <pre><code>var point1 = new Point(5, 10);
  242. var point2 = new Point(10, 20);
  243. var result = point1 + point2;
  244. console.log(result); // {x: 15, y: 30}</code></pre>
  245. </div>
  246. </div>
  247. </div>
  248. <div id="subtract" class="member">
  249. <div class="member-link">
  250. <a name="subtract" href="#subtract"><tt><tt><b>-</b>number</tt>, <tt><b>-</b>point</tt></tt></a>
  251. </div>
  252. <div class="member-description hidden">
  253. <div class="member-text">
  254. <p>Returns the subtraction of the supplied value to both coordinates of the point as a new point. The object itself is not modified!</p>
  255. <ul class="member-list">
  256. <h4>Parameters:</h4>
  257. <li>
  258. <tt>number:</tt>
  259. <tt>Number</tt>
  260. &mdash;&nbsp;the number to subtract
  261. </li>
  262. </ul>
  263. <ul class="member-list">
  264. <h4>Returns:</h4>
  265. <li>
  266. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the subtraction of the point and the value as a new point
  267. </li>
  268. </ul>
  269. <h4>Example:</h4>
  270. <pre><code>var point = new Point(10, 20);
  271. var result = point - 5;
  272. console.log(result); // {x: 5, y: 15}</code></pre>
  273. </div>
  274. <div class="member-text">
  275. <p>Returns the subtraction of the supplied point to the point as a new point. The object itself is not modified!</p>
  276. <ul class="member-list">
  277. <h4>Parameters:</h4>
  278. <li>
  279. <tt>point:</tt>
  280. <a href="../classes/Point.html"><tt>Point</tt></a>
  281. &mdash;&nbsp;the point to subtract
  282. </li>
  283. </ul>
  284. <ul class="member-list">
  285. <h4>Returns:</h4>
  286. <li>
  287. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the subtraction of the two points as a new point
  288. </li>
  289. </ul>
  290. <h4>Example:</h4>
  291. <pre><code>var firstPoint = new Point(10, 20);
  292. var secondPoint = new Point(5, 5);
  293. var result = firstPoint - secondPoint;
  294. console.log(result); // {x: 5, y: 15}</code></pre>
  295. </div>
  296. </div>
  297. </div>
  298. <div id="multiply" class="member">
  299. <div class="member-link">
  300. <a name="multiply" href="#multiply"><tt><tt><b>*</b>number</tt>, <tt><b>*</b>point</tt></tt></a>
  301. </div>
  302. <div class="member-description hidden">
  303. <div class="member-text">
  304. <p>Returns the multiplication of the supplied value to both coordinates of the point as a new point. The object itself is not modified!</p>
  305. <ul class="member-list">
  306. <h4>Parameters:</h4>
  307. <li>
  308. <tt>number:</tt>
  309. <tt>Number</tt>
  310. &mdash;&nbsp;the number to multiply by
  311. </li>
  312. </ul>
  313. <ul class="member-list">
  314. <h4>Returns:</h4>
  315. <li>
  316. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the multiplication of the point and the value as a new point
  317. </li>
  318. </ul>
  319. <h4>Example:</h4>
  320. <pre><code>var point = new Point(10, 20);
  321. var result = point * 2;
  322. console.log(result); // {x: 20, y: 40}</code></pre>
  323. </div>
  324. <div class="member-text">
  325. <p>Returns the multiplication of the supplied point to the point as a new point. The object itself is not modified!</p>
  326. <ul class="member-list">
  327. <h4>Parameters:</h4>
  328. <li>
  329. <tt>point:</tt>
  330. <a href="../classes/Point.html"><tt>Point</tt></a>
  331. &mdash;&nbsp;the point to multiply by
  332. </li>
  333. </ul>
  334. <ul class="member-list">
  335. <h4>Returns:</h4>
  336. <li>
  337. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the multiplication of the two points as a new point
  338. </li>
  339. </ul>
  340. <h4>Example:</h4>
  341. <pre><code>var firstPoint = new Point(5, 10);
  342. var secondPoint = new Point(4, 2);
  343. var result = firstPoint * secondPoint;
  344. console.log(result); // {x: 20, y: 20}</code></pre>
  345. </div>
  346. </div>
  347. </div>
  348. <div id="divide" class="member">
  349. <div class="member-link">
  350. <a name="divide" href="#divide"><tt><tt><b>/</b>number</tt>, <tt><b>/</b>point</tt></tt></a>
  351. </div>
  352. <div class="member-description hidden">
  353. <div class="member-text">
  354. <p>Returns the division of the supplied value to both coordinates of the point as a new point. The object itself is not modified!</p>
  355. <ul class="member-list">
  356. <h4>Parameters:</h4>
  357. <li>
  358. <tt>number:</tt>
  359. <tt>Number</tt>
  360. &mdash;&nbsp;the number to divide by
  361. </li>
  362. </ul>
  363. <ul class="member-list">
  364. <h4>Returns:</h4>
  365. <li>
  366. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the division of the point and the value as a new point
  367. </li>
  368. </ul>
  369. <h4>Example:</h4>
  370. <pre><code>var point = new Point(10, 20);
  371. var result = point / 2;
  372. console.log(result); // {x: 5, y: 10}</code></pre>
  373. </div>
  374. <div class="member-text">
  375. <p>Returns the division of the supplied point to the point as a new point. The object itself is not modified!</p>
  376. <ul class="member-list">
  377. <h4>Parameters:</h4>
  378. <li>
  379. <tt>point:</tt>
  380. <a href="../classes/Point.html"><tt>Point</tt></a>
  381. &mdash;&nbsp;the point to divide by
  382. </li>
  383. </ul>
  384. <ul class="member-list">
  385. <h4>Returns:</h4>
  386. <li>
  387. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the division of the two points as a new point
  388. </li>
  389. </ul>
  390. <h4>Example:</h4>
  391. <pre><code>var firstPoint = new Point(8, 10);
  392. var secondPoint = new Point(2, 5);
  393. var result = firstPoint / secondPoint;
  394. console.log(result); // {x: 4, y: 2}</code></pre>
  395. </div>
  396. </div>
  397. </div>
  398. <div id="modulo" class="member">
  399. <div class="member-link">
  400. <a name="modulo" href="#modulo"><tt><tt><b>%</b>number</tt>, <tt><b>%</b>point</tt></tt></a>
  401. </div>
  402. <div class="member-description hidden">
  403. <div class="member-text">
  404. <p>The modulo operator returns the integer remainders of dividing the point by the supplied value as a new point.</p>
  405. <ul class="member-list">
  406. <h4>Parameters:</h4>
  407. <li>
  408. <tt>value:</tt>
  409. <tt>Number</tt>
  410. </li>
  411. </ul>
  412. <ul class="member-list">
  413. <h4>Returns:</h4>
  414. <li>
  415. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the integer remainders of dividing the point by the value as a new point
  416. </li>
  417. </ul>
  418. <h4>Example:</h4>
  419. <pre><code>var point = new Point(12, 6);
  420. console.log(point % 5); // {x: 2, y: 1}</code></pre>
  421. </div>
  422. <div class="member-text">
  423. <p>The modulo operator returns the integer remainders of dividing the point by the supplied value as a new point.</p>
  424. <ul class="member-list">
  425. <h4>Parameters:</h4>
  426. <li>
  427. <tt>point:</tt>
  428. <a href="../classes/Point.html"><tt>Point</tt></a>
  429. </li>
  430. </ul>
  431. <ul class="member-list">
  432. <h4>Returns:</h4>
  433. <li>
  434. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the integer remainders of dividing the points by each other as a new point
  435. </li>
  436. </ul>
  437. <h4>Example:</h4>
  438. <pre><code>var point = new Point(12, 6);
  439. console.log(point % new Point(5, 2)); // {x: 2, y: 0}</code></pre>
  440. </div>
  441. </div>
  442. </div>
  443. </div>
  444. <!-- ================================ properties =========================== -->
  445. <div class="reference-members">
  446. <h2>Properties</h2>
  447. <div id="x" class="member">
  448. <div class="member-link">
  449. <a name="x" href="#x"><tt><b>x</b></tt></a>
  450. </div>
  451. <div class="member-description hidden">
  452. <div class="member-text">
  453. <p>The x coordinate of the point</p>
  454. <ul class="member-list">
  455. <h4>Type:</h4>
  456. <li>
  457. <tt>Number</tt>
  458. </li>
  459. </ul>
  460. </div>
  461. </div>
  462. </div>
  463. <div id="y" class="member">
  464. <div class="member-link">
  465. <a name="y" href="#y"><tt><b>y</b></tt></a>
  466. </div>
  467. <div class="member-description hidden">
  468. <div class="member-text">
  469. <p>The y coordinate of the point</p>
  470. <ul class="member-list">
  471. <h4>Type:</h4>
  472. <li>
  473. <tt>Number</tt>
  474. </li>
  475. </ul>
  476. </div>
  477. </div>
  478. </div>
  479. <div id="length" class="member">
  480. <div class="member-link">
  481. <a name="length" href="#length"><tt><b>length</b></tt></a>
  482. </div>
  483. <div class="member-description hidden">
  484. <div class="member-text">
  485. <p>The length of the vector that is represented by this point&rsquo;s coordinates. Each point can be interpreted as a vector that points from the origin (<code>x
  486. = 0</code>, <code>y = 0</code>) to the point&rsquo;s location. Setting the length changes the location but keeps the vector&rsquo;s angle.</p>
  487. <ul class="member-list">
  488. <h4>Type:</h4>
  489. <li>
  490. <tt>Number</tt>
  491. </li>
  492. </ul>
  493. </div>
  494. </div>
  495. </div>
  496. <div id="angle" class="member">
  497. <div class="member-link">
  498. <a name="angle" href="#angle"><tt><b>angle</b></tt></a>
  499. </div>
  500. <div class="member-description hidden">
  501. <div class="member-text">
  502. <p>The vector&rsquo;s angle in degrees, measured from the x-axis to the vector.</p>
  503. <ul class="member-list">
  504. <h4>Type:</h4>
  505. <li>
  506. <tt>Number</tt>
  507. </li>
  508. </ul>
  509. </div>
  510. </div>
  511. </div>
  512. <div id="angleinradians" class="member">
  513. <div class="member-link">
  514. <a name="angleinradians" href="#angleinradians"><tt><b>angleInRadians</b></tt></a>
  515. </div>
  516. <div class="member-description hidden">
  517. <div class="member-text">
  518. <p>The vector&rsquo;s angle in radians, measured from the x-axis to the vector.</p>
  519. <ul class="member-list">
  520. <h4>Type:</h4>
  521. <li>
  522. <tt>Number</tt>
  523. </li>
  524. </ul>
  525. </div>
  526. </div>
  527. </div>
  528. <div id="quadrant" class="member">
  529. <div class="member-link">
  530. <a name="quadrant" href="#quadrant"><tt><b>quadrant</b></tt></a>
  531. </div>
  532. <div class="member-description hidden">
  533. <div class="member-text">
  534. <p>The quadrant of the <a href="../classes/Point.html#angle"><tt>angle</tt></a> of the point.</p>
  535. <p>Angles between 0 and 90 degrees are in quadrant <code>1</code>. Angles between 90 and 180 degrees are in quadrant <code>2</code>, angles between 180 and 270 degrees are in quadrant <code>3</code> and angles between 270 and 360 degrees are in quadrant <code>4</code>.</p>
  536. <p>Read only.</p>
  537. <ul class="member-list">
  538. <h4>Type:</h4>
  539. <li>
  540. <tt>Number</tt>
  541. </li>
  542. </ul>
  543. <h4>Example:</h4>
  544. <pre><code>var point = new Point({
  545. angle: 10,
  546. length: 20
  547. });
  548. console.log(point.quadrant); // 1
  549. point.angle = 100;
  550. console.log(point.quadrant); // 2
  551. point.angle = 190;
  552. console.log(point.quadrant); // 3
  553. point.angle = 280;
  554. console.log(point.quadrant); // 4</code></pre>
  555. </div>
  556. </div>
  557. </div>
  558. <div id="selected" class="member">
  559. <div class="member-link">
  560. <a name="selected" href="#selected"><tt><b>selected</b></tt></a>
  561. </div>
  562. <div class="member-description hidden">
  563. <div class="member-text">
  564. <p>This property is only valid if the point is an anchor or handle point of a <a href="../classes/Segment.html"><tt>Segment</tt></a> or a <a href="../classes/Curve.html"><tt>Curve</tt></a>, or the position of an <a href="../classes/Item.html"><tt>Item</tt></a>, as returned by <a href="../classes/Item.html#position"><tt>item.position</tt></a>, <a href="../classes/Segment.html#point"><tt>segment.point</tt></a>, <a href="../classes/Segment.html#handlein"><tt>segment.handleIn</tt></a>, <a href="../classes/Segment.html#handleout"><tt>segment.handleOut</tt></a>, <a href="../classes/Curve.html#point1"><tt>curve.point1</tt></a>, <a href="../classes/Curve.html#point2"><tt>curve.point2</tt></a>, <a href="../classes/Curve.html#handle1"><tt>curve.handle1</tt></a>, <a href="../classes/Curve.html#handle2"><tt>curve.handle2</tt></a>.</p>
  565. <p>In those cases, it returns <tt>true</tt> if it the point is selected, <tt>false</tt> otherwise.</p>
  566. <p>Paper.js renders selected points on top of your project. This is very useful when debugging.</p>
  567. <ul class="member-list">
  568. <h4>Default:</h4>
  569. <li><tt>false</tt></li>
  570. </ul>
  571. <ul class="member-list">
  572. <h4>Type:</h4>
  573. <li>
  574. <tt>Boolean</tt>
  575. </li>
  576. </ul>
  577. <h4>Example:</h4>
  578. <div class="paperscript split">
  579. <div class="buttons">
  580. <div class="button run">Run</div>
  581. </div>
  582. <script type="text/paperscript" canvas="canvas-0">
  583. var path = new Path.Circle({
  584. center: [80, 50],
  585. radius: 40
  586. });
  587. // Select the third segment point:
  588. path.segments[2].point.selected = true;
  589. // Select the item's position, which is the pivot point
  590. // around which it is transformed:
  591. path.position.selected = true;
  592. </script>
  593. <div class="canvas"><canvas width="516" height="100" id="canvas-0"></canvas></div>
  594. </div>
  595. </div>
  596. </div>
  597. </div>
  598. </div>
  599. <!-- ============================== methods ================================ -->
  600. <div class="reference-members">
  601. <h2>Methods</h2>
  602. <div id="set-values" class="member">
  603. <div class="member-link">
  604. <a name="set-values" href="#set-values"><tt><b>set</b>(...values)</tt></a>
  605. </div>
  606. <div class="member-description hidden">
  607. <div class="member-text">
  608. <p>Sets the point to the passed values. Note that any sequence of parameters that is supported by the various <a href="../classes/Point.html"><tt>Point</tt></a>() constructors also work for calls of <code>set()</code>.</p>
  609. <ul class="member-list">
  610. <h4>Parameters:</h4>
  611. <li>
  612. <tt>values:</tt>
  613. <tt>any value</tt>
  614. </li>
  615. </ul>
  616. <ul class="member-list">
  617. <h4>Returns:</h4>
  618. <li>
  619. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>
  620. </li>
  621. </ul>
  622. </div>
  623. </div>
  624. </div>
  625. <div id="equals-point" class="member">
  626. <div class="member-link">
  627. <a name="equals-point" href="#equals-point"><tt><b>equals</b>(point)</tt></a>
  628. </div>
  629. <div class="member-description hidden">
  630. <div class="member-text">
  631. <p>Checks whether the coordinates of the point are equal to that of the supplied point.</p>
  632. <ul class="member-list">
  633. <h4>Parameters:</h4>
  634. <li>
  635. <tt>point:</tt>
  636. <a href="../classes/Point.html"><tt>Point</tt></a>
  637. </li>
  638. </ul>
  639. <ul class="member-list">
  640. <h4>Returns:</h4>
  641. <li>
  642. <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the points are equal, <tt>false</tt> otherwise
  643. </li>
  644. </ul>
  645. <h4>Example:</h4>
  646. <pre><code>var point = new Point(5, 10);
  647. console.log(point == new Point(5, 10)); // true
  648. console.log(point == new Point(1, 1)); // false
  649. console.log(point != new Point(1, 1)); // true</code></pre>
  650. </div>
  651. </div>
  652. </div>
  653. <div id="clone" class="member">
  654. <div class="member-link">
  655. <a name="clone" href="#clone"><tt><b>clone</b>()</tt></a>
  656. </div>
  657. <div class="member-description hidden">
  658. <div class="member-text">
  659. <p>Returns a copy of the point.</p>
  660. <ul class="member-list">
  661. <h4>Returns:</h4>
  662. <li>
  663. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the cloned point
  664. </li>
  665. </ul>
  666. <h4>Example:</h4>
  667. <pre><code>var point1 = new Point();
  668. var point2 = point1;
  669. point2.x = 1; // also changes point1.x
  670. var point2 = point1.clone();
  671. point2.x = 1; // doesn't change point1.x</code></pre>
  672. </div>
  673. </div>
  674. </div>
  675. <div id="tostring" class="member">
  676. <div class="member-link">
  677. <a name="tostring" href="#tostring"><tt><b>toString</b>()</tt></a>
  678. </div>
  679. <div class="member-description hidden">
  680. <div class="member-text">
  681. <ul class="member-list">
  682. <h4>Returns:</h4>
  683. <li>
  684. <tt><tt>String</tt></tt>&nbsp;&mdash;&nbsp;a string representation of the point
  685. </li>
  686. </ul>
  687. </div>
  688. </div>
  689. </div>
  690. <div id="getangle-point" class="member">
  691. <div class="member-link">
  692. <a name="getangle-point" href="#getangle-point"><tt><b>getAngle</b>(point)</tt></a>
  693. </div>
  694. <div class="member-description hidden">
  695. <div class="member-text">
  696. <p>Returns the smaller angle between two vectors. The angle is unsigned, no information about rotational direction is given.</p>
  697. <ul class="member-list">
  698. <h4>Parameters:</h4>
  699. <li>
  700. <tt>point:</tt>
  701. <a href="../classes/Point.html"><tt>Point</tt></a>
  702. </li>
  703. </ul>
  704. <ul class="member-list">
  705. <h4>Returns:</h4>
  706. <li>
  707. <tt><tt>Number</tt></tt>&nbsp;&mdash;&nbsp;the angle in degrees
  708. </li>
  709. </ul>
  710. </div>
  711. </div>
  712. </div>
  713. <div id="getangleinradians-point" class="member">
  714. <div class="member-link">
  715. <a name="getangleinradians-point" href="#getangleinradians-point"><tt><b>getAngleInRadians</b>(point)</tt></a>
  716. </div>
  717. <div class="member-description hidden">
  718. <div class="member-text">
  719. <p>Returns the smaller angle between two vectors in radians. The angle is unsigned, no information about rotational direction is given.</p>
  720. <ul class="member-list">
  721. <h4>Parameters:</h4>
  722. <li>
  723. <tt>point:</tt>
  724. <a href="../classes/Point.html"><tt>Point</tt></a>
  725. </li>
  726. </ul>
  727. <ul class="member-list">
  728. <h4>Returns:</h4>
  729. <li>
  730. <tt><tt>Number</tt></tt>&nbsp;&mdash;&nbsp;the angle in radians
  731. </li>
  732. </ul>
  733. </div>
  734. </div>
  735. </div>
  736. <div id="getdirectedangle-point" class="member">
  737. <div class="member-link">
  738. <a name="getdirectedangle-point" href="#getdirectedangle-point"><tt><b>getDirectedAngle</b>(point)</tt></a>
  739. </div>
  740. <div class="member-description hidden">
  741. <div class="member-text">
  742. <p>Returns the angle between two vectors. The angle is directional and signed, giving information about the rotational direction.</p>
  743. <p>Read more about angle units and orientation in the description of the <a href="../classes/Point.html#angle"><tt>angle</tt></a> property.</p>
  744. <ul class="member-list">
  745. <h4>Parameters:</h4>
  746. <li>
  747. <tt>point:</tt>
  748. <a href="../classes/Point.html"><tt>Point</tt></a>
  749. </li>
  750. </ul>
  751. <ul class="member-list">
  752. <h4>Returns:</h4>
  753. <li>
  754. <tt><tt>Number</tt></tt>&nbsp;&mdash;&nbsp;the angle between the two vectors
  755. </li>
  756. </ul>
  757. </div>
  758. </div>
  759. </div>
  760. <div id="getdistance-point" class="member">
  761. <div class="member-link">
  762. <a name="getdistance-point" href="#getdistance-point"><tt><b>getDistance</b>(point[, squared])</tt></a>
  763. </div>
  764. <div class="member-description hidden">
  765. <div class="member-text">
  766. <p>Returns the distance between the point and another point.</p>
  767. <ul class="member-list">
  768. <h4>Parameters:</h4>
  769. <li>
  770. <tt>point:</tt>
  771. <a href="../classes/Point.html"><tt>Point</tt></a>
  772. </li>
  773. <li>
  774. <tt>squared:</tt>
  775. <tt>Boolean</tt>
  776. &mdash;&nbsp;Controls whether the distance should remain squared, or its square root should be calculated
  777. &mdash;&nbsp;optional, default: <tt>false</tt>
  778. </li>
  779. </ul>
  780. <ul class="member-list">
  781. <h4>Returns:</h4>
  782. <li>
  783. <tt><tt>Number</tt></tt>
  784. </li>
  785. </ul>
  786. </div>
  787. </div>
  788. </div>
  789. <div id="normalize" class="member">
  790. <div class="member-link">
  791. <a name="normalize" href="#normalize"><tt><b>normalize</b>([length])</tt></a>
  792. </div>
  793. <div class="member-description hidden">
  794. <div class="member-text">
  795. <p>Normalize modifies the <a href="../classes/Point.html#length"><tt>length</tt></a> of the vector to <code>1</code> without changing its angle and returns it as a new point. The optional <code>length</code> parameter defines the length to normalize to. The object itself is not modified!</p>
  796. <ul class="member-list">
  797. <h4>Parameters:</h4>
  798. <li>
  799. <tt>length:</tt>
  800. <tt>Number</tt>
  801. &mdash;&nbsp;The length of the normalized vector
  802. &mdash;&nbsp;optional, default: <tt>1</tt>
  803. </li>
  804. </ul>
  805. <ul class="member-list">
  806. <h4>Returns:</h4>
  807. <li>
  808. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the normalized vector of the vector that is represented by this point&rsquo;s coordinates
  809. </li>
  810. </ul>
  811. </div>
  812. </div>
  813. </div>
  814. <div id="rotate-angle-center" class="member">
  815. <div class="member-link">
  816. <a name="rotate-angle-center" href="#rotate-angle-center"><tt><b>rotate</b>(angle, center)</tt></a>
  817. </div>
  818. <div class="member-description hidden">
  819. <div class="member-text">
  820. <p>Rotates the point by the given angle around an optional center point. The object itself is not modified.</p>
  821. <p>Read more about angle units and orientation in the description of the <a href="../classes/Point.html#angle"><tt>angle</tt></a> property.</p>
  822. <ul class="member-list">
  823. <h4>Parameters:</h4>
  824. <li>
  825. <tt>angle:</tt>
  826. <tt>Number</tt>
  827. &mdash;&nbsp;the rotation angle
  828. </li>
  829. <li>
  830. <tt>center:</tt>
  831. <a href="../classes/Point.html"><tt>Point</tt></a>
  832. &mdash;&nbsp;the center point of the rotation
  833. </li>
  834. </ul>
  835. <ul class="member-list">
  836. <h4>Returns:</h4>
  837. <li>
  838. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the rotated point
  839. </li>
  840. </ul>
  841. </div>
  842. </div>
  843. </div>
  844. <div id="transform-matrix" class="member">
  845. <div class="member-link">
  846. <a name="transform-matrix" href="#transform-matrix"><tt><b>transform</b>(matrix)</tt></a>
  847. </div>
  848. <div class="member-description hidden">
  849. <div class="member-text">
  850. <p>Transforms the point by the matrix as a new point. The object itself is not modified!</p>
  851. <ul class="member-list">
  852. <h4>Parameters:</h4>
  853. <li>
  854. <tt>matrix:</tt>
  855. <a href="../classes/Matrix.html"><tt>Matrix</tt></a>
  856. </li>
  857. </ul>
  858. <ul class="member-list">
  859. <h4>Returns:</h4>
  860. <li>
  861. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the transformed point
  862. </li>
  863. </ul>
  864. </div>
  865. </div>
  866. </div>
  867. <h3>Tests</h3>
  868. <div id="isinside-rect" class="member">
  869. <div class="member-link">
  870. <a name="isinside-rect" href="#isinside-rect"><tt><b>isInside</b>(rect)</tt></a>
  871. </div>
  872. <div class="member-description hidden">
  873. <div class="member-text">
  874. <p>Checks whether the point is inside the boundaries of the rectangle.</p>
  875. <ul class="member-list">
  876. <h4>Parameters:</h4>
  877. <li>
  878. <tt>rect:</tt>
  879. <a href="../classes/Rectangle.html"><tt>Rectangle</tt></a>
  880. &mdash;&nbsp;the rectangle to check against
  881. </li>
  882. </ul>
  883. <ul class="member-list">
  884. <h4>Returns:</h4>
  885. <li>
  886. <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if the point is inside the rectangle, <tt>false</tt> otherwise
  887. </li>
  888. </ul>
  889. </div>
  890. </div>
  891. </div>
  892. <div id="isclose-point-tolerance" class="member">
  893. <div class="member-link">
  894. <a name="isclose-point-tolerance" href="#isclose-point-tolerance"><tt><b>isClose</b>(point, tolerance)</tt></a>
  895. </div>
  896. <div class="member-description hidden">
  897. <div class="member-text">
  898. <p>Checks if the point is within a given distance of another point.</p>
  899. <ul class="member-list">
  900. <h4>Parameters:</h4>
  901. <li>
  902. <tt>point:</tt>
  903. <a href="../classes/Point.html"><tt>Point</tt></a>
  904. &mdash;&nbsp;the point to check against
  905. </li>
  906. <li>
  907. <tt>tolerance:</tt>
  908. <tt>Number</tt>
  909. &mdash;&nbsp;the maximum distance allowed
  910. </li>
  911. </ul>
  912. <ul class="member-list">
  913. <h4>Returns:</h4>
  914. <li>
  915. <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if it is within the given distance, <tt>false</tt> otherwise
  916. </li>
  917. </ul>
  918. </div>
  919. </div>
  920. </div>
  921. <div id="iscollinear-point" class="member">
  922. <div class="member-link">
  923. <a name="iscollinear-point" href="#iscollinear-point"><tt><b>isCollinear</b>(point)</tt></a>
  924. </div>
  925. <div class="member-description hidden">
  926. <div class="member-text">
  927. <p>Checks if the vector represented by this point is collinear (parallel) to another vector.</p>
  928. <ul class="member-list">
  929. <h4>Parameters:</h4>
  930. <li>
  931. <tt>point:</tt>
  932. <a href="../classes/Point.html"><tt>Point</tt></a>
  933. &mdash;&nbsp;the vector to check against
  934. </li>
  935. </ul>
  936. <ul class="member-list">
  937. <h4>Returns:</h4>
  938. <li>
  939. <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> it is collinear, <tt>false</tt> otherwise
  940. </li>
  941. </ul>
  942. </div>
  943. </div>
  944. </div>
  945. <div id="isorthogonal-point" class="member">
  946. <div class="member-link">
  947. <a name="isorthogonal-point" href="#isorthogonal-point"><tt><b>isOrthogonal</b>(point)</tt></a>
  948. </div>
  949. <div class="member-description hidden">
  950. <div class="member-text">
  951. <p>Checks if the vector represented by this point is orthogonal (perpendicular) to another vector.</p>
  952. <ul class="member-list">
  953. <h4>Parameters:</h4>
  954. <li>
  955. <tt>point:</tt>
  956. <a href="../classes/Point.html"><tt>Point</tt></a>
  957. &mdash;&nbsp;the vector to check against
  958. </li>
  959. </ul>
  960. <ul class="member-list">
  961. <h4>Returns:</h4>
  962. <li>
  963. <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> it is orthogonal, <tt>false</tt> otherwise
  964. </li>
  965. </ul>
  966. </div>
  967. </div>
  968. </div>
  969. <div id="iszero" class="member">
  970. <div class="member-link">
  971. <a name="iszero" href="#iszero"><tt><b>isZero</b>()</tt></a>
  972. </div>
  973. <div class="member-description hidden">
  974. <div class="member-text">
  975. <p>Checks if this point has both the x and y coordinate set to 0.</p>
  976. <ul class="member-list">
  977. <h4>Returns:</h4>
  978. <li>
  979. <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if both x and y are 0, <tt>false</tt> otherwise
  980. </li>
  981. </ul>
  982. </div>
  983. </div>
  984. </div>
  985. <div id="isnan" class="member">
  986. <div class="member-link">
  987. <a name="isnan" href="#isnan"><tt><b>isNaN</b>()</tt></a>
  988. </div>
  989. <div class="member-description hidden">
  990. <div class="member-text">
  991. <p>Checks if this point has an undefined value for at least one of its coordinates.</p>
  992. <ul class="member-list">
  993. <h4>Returns:</h4>
  994. <li>
  995. <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if either x or y are not a number, <tt>false</tt> otherwise
  996. </li>
  997. </ul>
  998. </div>
  999. </div>
  1000. </div>
  1001. <div id="isinquadrant-quadrant" class="member">
  1002. <div class="member-link">
  1003. <a name="isinquadrant-quadrant" href="#isinquadrant-quadrant"><tt><b>isInQuadrant</b>(quadrant)</tt></a>
  1004. </div>
  1005. <div class="member-description hidden">
  1006. <div class="member-text">
  1007. <p>Checks if the vector is within the specified quadrant. Note that if the vector lies on the boundary between two quadrants, <code>true</code> will be returned for both quadrants.</p>
  1008. <ul class="member-list">
  1009. <h4>Parameters:</h4>
  1010. <li>
  1011. <tt>quadrant:</tt>
  1012. <tt>Number</tt>
  1013. &mdash;&nbsp;the quadrant to check against
  1014. </li>
  1015. </ul>
  1016. <ul class="member-list">
  1017. <h4>Returns:</h4>
  1018. <li>
  1019. <tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if either x or y are not a number, <tt>false</tt> otherwise
  1020. </li>
  1021. </ul>
  1022. <ul class="member-list">
  1023. <h4>See also:</h4>
  1024. <li><tt><a href="../classes/Point.html#quadrant"><tt>quadrant</tt></a></tt></li>
  1025. </ul>
  1026. </div>
  1027. </div>
  1028. </div>
  1029. <h3>Vector Math Functions</h3>
  1030. <div id="dot-point" class="member">
  1031. <div class="member-link">
  1032. <a name="dot-point" href="#dot-point"><tt><b>dot</b>(point)</tt></a>
  1033. </div>
  1034. <div class="member-description hidden">
  1035. <div class="member-text">
  1036. <p>Returns the dot product of the point and another point.</p>
  1037. <ul class="member-list">
  1038. <h4>Parameters:</h4>
  1039. <li>
  1040. <tt>point:</tt>
  1041. <a href="../classes/Point.html"><tt>Point</tt></a>
  1042. </li>
  1043. </ul>
  1044. <ul class="member-list">
  1045. <h4>Returns:</h4>
  1046. <li>
  1047. <tt><tt>Number</tt></tt>&nbsp;&mdash;&nbsp;the dot product of the two points
  1048. </li>
  1049. </ul>
  1050. </div>
  1051. </div>
  1052. </div>
  1053. <div id="cross-point" class="member">
  1054. <div class="member-link">
  1055. <a name="cross-point" href="#cross-point"><tt><b>cross</b>(point)</tt></a>
  1056. </div>
  1057. <div class="member-description hidden">
  1058. <div class="member-text">
  1059. <p>Returns the cross product of the point and another point.</p>
  1060. <ul class="member-list">
  1061. <h4>Parameters:</h4>
  1062. <li>
  1063. <tt>point:</tt>
  1064. <a href="../classes/Point.html"><tt>Point</tt></a>
  1065. </li>
  1066. </ul>
  1067. <ul class="member-list">
  1068. <h4>Returns:</h4>
  1069. <li>
  1070. <tt><tt>Number</tt></tt>&nbsp;&mdash;&nbsp;the cross product of the two points
  1071. </li>
  1072. </ul>
  1073. </div>
  1074. </div>
  1075. </div>
  1076. <div id="project-point" class="member">
  1077. <div class="member-link">
  1078. <a name="project-point" href="#project-point"><tt><b>project</b>(point)</tt></a>
  1079. </div>
  1080. <div class="member-description hidden">
  1081. <div class="member-text">
  1082. <p>Returns the projection of the point onto another point. Both points are interpreted as vectors.</p>
  1083. <ul class="member-list">
  1084. <h4>Parameters:</h4>
  1085. <li>
  1086. <tt>point:</tt>
  1087. <a href="../classes/Point.html"><tt>Point</tt></a>
  1088. </li>
  1089. </ul>
  1090. <ul class="member-list">
  1091. <h4>Returns:</h4>
  1092. <li>
  1093. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the projection of the point onto another point
  1094. </li>
  1095. </ul>
  1096. </div>
  1097. </div>
  1098. </div>
  1099. <h3>Math Functions</h3>
  1100. <div id="round" class="member">
  1101. <div class="member-link">
  1102. <a name="round" href="#round"><tt><b>round</b>()</tt></a>
  1103. </div>
  1104. <div class="member-description hidden">
  1105. <div class="member-text">
  1106. <p>Returns a new point with rounded <a href="../classes/Point.html#x"><tt>x</tt></a> and <a href="../classes/Point.html#y"><tt>y</tt></a> values. The object itself is not modified!</p>
  1107. <ul class="member-list">
  1108. <h4>Returns:</h4>
  1109. <li>
  1110. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>
  1111. </li>
  1112. </ul>
  1113. <h4>Example:</h4>
  1114. <pre><code>var point = new Point(10.2, 10.9);
  1115. var roundPoint = point.round();
  1116. console.log(roundPoint); // {x: 10, y: 11}</code></pre>
  1117. </div>
  1118. </div>
  1119. </div>
  1120. <div id="ceil" class="member">
  1121. <div class="member-link">
  1122. <a name="ceil" href="#ceil"><tt><b>ceil</b>()</tt></a>
  1123. </div>
  1124. <div class="member-description hidden">
  1125. <div class="member-text">
  1126. <p>Returns a new point with the nearest greater non-fractional values to the specified <a href="../classes/Point.html#x"><tt>x</tt></a> and <a href="../classes/Point.html#y"><tt>y</tt></a> values. The object itself is not modified!</p>
  1127. <ul class="member-list">
  1128. <h4>Returns:</h4>
  1129. <li>
  1130. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>
  1131. </li>
  1132. </ul>
  1133. <h4>Example:</h4>
  1134. <pre><code>var point = new Point(10.2, 10.9);
  1135. var ceilPoint = point.ceil();
  1136. console.log(ceilPoint); // {x: 11, y: 11}</code></pre>
  1137. </div>
  1138. </div>
  1139. </div>
  1140. <div id="floor" class="member">
  1141. <div class="member-link">
  1142. <a name="floor" href="#floor"><tt><b>floor</b>()</tt></a>
  1143. </div>
  1144. <div class="member-description hidden">
  1145. <div class="member-text">
  1146. <p>Returns a new point with the nearest smaller non-fractional values to the specified <a href="../classes/Point.html#x"><tt>x</tt></a> and <a href="../classes/Point.html#y"><tt>y</tt></a> values. The object itself is not modified!</p>
  1147. <ul class="member-list">
  1148. <h4>Returns:</h4>
  1149. <li>
  1150. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>
  1151. </li>
  1152. </ul>
  1153. <h4>Example:</h4>
  1154. <pre><code>var point = new Point(10.2, 10.9);
  1155. var floorPoint = point.floor();
  1156. console.log(floorPoint); // {x: 10, y: 10}</code></pre>
  1157. </div>
  1158. </div>
  1159. </div>
  1160. <div id="abs" class="member">
  1161. <div class="member-link">
  1162. <a name="abs" href="#abs"><tt><b>abs</b>()</tt></a>
  1163. </div>
  1164. <div class="member-description hidden">
  1165. <div class="member-text">
  1166. <p>Returns a new point with the absolute values of the specified <a href="../classes/Point.html#x"><tt>x</tt></a> and <a href="../classes/Point.html#y"><tt>y</tt></a> values. The object itself is not modified!</p>
  1167. <ul class="member-list">
  1168. <h4>Returns:</h4>
  1169. <li>
  1170. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>
  1171. </li>
  1172. </ul>
  1173. <h4>Example:</h4>
  1174. <pre><code>var point = new Point(-5, 10);
  1175. var absPoint = point.abs();
  1176. console.log(absPoint); // {x: 5, y: 10}</code></pre>
  1177. </div>
  1178. </div>
  1179. </div>
  1180. <h3>Math Operator Functions</h3>
  1181. <div id="add-number" class="member">
  1182. <div class="member-link">
  1183. <a name="add-number" href="#add-number"><tt><b>add</b>(number)</tt></a>
  1184. </div>
  1185. <div class="member-description hidden">
  1186. <div class="member-text">
  1187. <p>Returns the addition of the supplied value to both coordinates of the point as a new point. The object itself is not modified!</p>
  1188. <ul class="member-list">
  1189. <h4>Parameters:</h4>
  1190. <li>
  1191. <tt>number:</tt>
  1192. <tt>Number</tt>
  1193. &mdash;&nbsp;the number to add
  1194. </li>
  1195. </ul>
  1196. <ul class="member-list">
  1197. <h4>Returns:</h4>
  1198. <li>
  1199. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the addition of the point and the value as a new point
  1200. </li>
  1201. </ul>
  1202. <h4>Example:</h4>
  1203. <pre><code>var point = new Point(5, 10);
  1204. var result = point + 20;
  1205. console.log(result); // {x: 25, y: 30}</code></pre>
  1206. </div>
  1207. </div>
  1208. </div>
  1209. <div id="add-point" class="member">
  1210. <div class="member-link">
  1211. <a name="add-point" href="#add-point"><tt><b>add</b>(point)</tt></a>
  1212. </div>
  1213. <div class="member-description hidden">
  1214. <div class="member-text">
  1215. <p>Returns the addition of the supplied point to the point as a new point. The object itself is not modified!</p>
  1216. <ul class="member-list">
  1217. <h4>Parameters:</h4>
  1218. <li>
  1219. <tt>point:</tt>
  1220. <a href="../classes/Point.html"><tt>Point</tt></a>
  1221. &mdash;&nbsp;the point to add
  1222. </li>
  1223. </ul>
  1224. <ul class="member-list">
  1225. <h4>Returns:</h4>
  1226. <li>
  1227. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the addition of the two points as a new point
  1228. </li>
  1229. </ul>
  1230. <h4>Example:</h4>
  1231. <pre><code>var point1 = new Point(5, 10);
  1232. var point2 = new Point(10, 20);
  1233. var result = point1 + point2;
  1234. console.log(result); // {x: 15, y: 30}</code></pre>
  1235. </div>
  1236. </div>
  1237. </div>
  1238. <div id="subtract-number" class="member">
  1239. <div class="member-link">
  1240. <a name="subtract-number" href="#subtract-number"><tt><b>subtract</b>(number)</tt></a>
  1241. </div>
  1242. <div class="member-description hidden">
  1243. <div class="member-text">
  1244. <p>Returns the subtraction of the supplied value to both coordinates of the point as a new point. The object itself is not modified!</p>
  1245. <ul class="member-list">
  1246. <h4>Parameters:</h4>
  1247. <li>
  1248. <tt>number:</tt>
  1249. <tt>Number</tt>
  1250. &mdash;&nbsp;the number to subtract
  1251. </li>
  1252. </ul>
  1253. <ul class="member-list">
  1254. <h4>Returns:</h4>
  1255. <li>
  1256. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the subtraction of the point and the value as a new point
  1257. </li>
  1258. </ul>
  1259. <h4>Example:</h4>
  1260. <pre><code>var point = new Point(10, 20);
  1261. var result = point - 5;
  1262. console.log(result); // {x: 5, y: 15}</code></pre>
  1263. </div>
  1264. </div>
  1265. </div>
  1266. <div id="subtract-point" class="member">
  1267. <div class="member-link">
  1268. <a name="subtract-point" href="#subtract-point"><tt><b>subtract</b>(point)</tt></a>
  1269. </div>
  1270. <div class="member-description hidden">
  1271. <div class="member-text">
  1272. <p>Returns the subtraction of the supplied point to the point as a new point. The object itself is not modified!</p>
  1273. <ul class="member-list">
  1274. <h4>Parameters:</h4>
  1275. <li>
  1276. <tt>point:</tt>
  1277. <a href="../classes/Point.html"><tt>Point</tt></a>
  1278. &mdash;&nbsp;the point to subtract
  1279. </li>
  1280. </ul>
  1281. <ul class="member-list">
  1282. <h4>Returns:</h4>
  1283. <li>
  1284. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the subtraction of the two points as a new point
  1285. </li>
  1286. </ul>
  1287. <h4>Example:</h4>
  1288. <pre><code>var firstPoint = new Point(10, 20);
  1289. var secondPoint = new Point(5, 5);
  1290. var result = firstPoint - secondPoint;
  1291. console.log(result); // {x: 5, y: 15}</code></pre>
  1292. </div>
  1293. </div>
  1294. </div>
  1295. <div id="multiply-number" class="member">
  1296. <div class="member-link">
  1297. <a name="multiply-number" href="#multiply-number"><tt><b>multiply</b>(number)</tt></a>
  1298. </div>
  1299. <div class="member-description hidden">
  1300. <div class="member-text">
  1301. <p>Returns the multiplication of the supplied value to both coordinates of the point as a new point. The object itself is not modified!</p>
  1302. <ul class="member-list">
  1303. <h4>Parameters:</h4>
  1304. <li>
  1305. <tt>number:</tt>
  1306. <tt>Number</tt>
  1307. &mdash;&nbsp;the number to multiply by
  1308. </li>
  1309. </ul>
  1310. <ul class="member-list">
  1311. <h4>Returns:</h4>
  1312. <li>
  1313. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the multiplication of the point and the value as a new point
  1314. </li>
  1315. </ul>
  1316. <h4>Example:</h4>
  1317. <pre><code>var point = new Point(10, 20);
  1318. var result = point * 2;
  1319. console.log(result); // {x: 20, y: 40}</code></pre>
  1320. </div>
  1321. </div>
  1322. </div>
  1323. <div id="multiply-point" class="member">
  1324. <div class="member-link">
  1325. <a name="multiply-point" href="#multiply-point"><tt><b>multiply</b>(point)</tt></a>
  1326. </div>
  1327. <div class="member-description hidden">
  1328. <div class="member-text">
  1329. <p>Returns the multiplication of the supplied point to the point as a new point. The object itself is not modified!</p>
  1330. <ul class="member-list">
  1331. <h4>Parameters:</h4>
  1332. <li>
  1333. <tt>point:</tt>
  1334. <a href="../classes/Point.html"><tt>Point</tt></a>
  1335. &mdash;&nbsp;the point to multiply by
  1336. </li>
  1337. </ul>
  1338. <ul class="member-list">
  1339. <h4>Returns:</h4>
  1340. <li>
  1341. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the multiplication of the two points as a new point
  1342. </li>
  1343. </ul>
  1344. <h4>Example:</h4>
  1345. <pre><code>var firstPoint = new Point(5, 10);
  1346. var secondPoint = new Point(4, 2);
  1347. var result = firstPoint * secondPoint;
  1348. console.log(result); // {x: 20, y: 20}</code></pre>
  1349. </div>
  1350. </div>
  1351. </div>
  1352. <div id="divide-number" class="member">
  1353. <div class="member-link">
  1354. <a name="divide-number" href="#divide-number"><tt><b>divide</b>(number)</tt></a>
  1355. </div>
  1356. <div class="member-description hidden">
  1357. <div class="member-text">
  1358. <p>Returns the division of the supplied value to both coordinates of the point as a new point. The object itself is not modified!</p>
  1359. <ul class="member-list">
  1360. <h4>Parameters:</h4>
  1361. <li>
  1362. <tt>number:</tt>
  1363. <tt>Number</tt>
  1364. &mdash;&nbsp;the number to divide by
  1365. </li>
  1366. </ul>
  1367. <ul class="member-list">
  1368. <h4>Returns:</h4>
  1369. <li>
  1370. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the division of the point and the value as a new point
  1371. </li>
  1372. </ul>
  1373. <h4>Example:</h4>
  1374. <pre><code>var point = new Point(10, 20);
  1375. var result = point / 2;
  1376. console.log(result); // {x: 5, y: 10}</code></pre>
  1377. </div>
  1378. </div>
  1379. </div>
  1380. <div id="divide-point" class="member">
  1381. <div class="member-link">
  1382. <a name="divide-point" href="#divide-point"><tt><b>divide</b>(point)</tt></a>
  1383. </div>
  1384. <div class="member-description hidden">
  1385. <div class="member-text">
  1386. <p>Returns the division of the supplied point to the point as a new point. The object itself is not modified!</p>
  1387. <ul class="member-list">
  1388. <h4>Parameters:</h4>
  1389. <li>
  1390. <tt>point:</tt>
  1391. <a href="../classes/Point.html"><tt>Point</tt></a>
  1392. &mdash;&nbsp;the point to divide by
  1393. </li>
  1394. </ul>
  1395. <ul class="member-list">
  1396. <h4>Returns:</h4>
  1397. <li>
  1398. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the division of the two points as a new point
  1399. </li>
  1400. </ul>
  1401. <h4>Example:</h4>
  1402. <pre><code>var firstPoint = new Point(8, 10);
  1403. var secondPoint = new Point(2, 5);
  1404. var result = firstPoint / secondPoint;
  1405. console.log(result); // {x: 4, y: 2}</code></pre>
  1406. </div>
  1407. </div>
  1408. </div>
  1409. <div id="modulo-value" class="member">
  1410. <div class="member-link">
  1411. <a name="modulo-value" href="#modulo-value"><tt><b>modulo</b>(value)</tt></a>
  1412. </div>
  1413. <div class="member-description hidden">
  1414. <div class="member-text">
  1415. <p>The modulo operator returns the integer remainders of dividing the point by the supplied value as a new point.</p>
  1416. <ul class="member-list">
  1417. <h4>Parameters:</h4>
  1418. <li>
  1419. <tt>value:</tt>
  1420. <tt>Number</tt>
  1421. </li>
  1422. </ul>
  1423. <ul class="member-list">
  1424. <h4>Returns:</h4>
  1425. <li>
  1426. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the integer remainders of dividing the point by the value as a new point
  1427. </li>
  1428. </ul>
  1429. <h4>Example:</h4>
  1430. <pre><code>var point = new Point(12, 6);
  1431. console.log(point % 5); // {x: 2, y: 1}</code></pre>
  1432. </div>
  1433. </div>
  1434. </div>
  1435. <div id="modulo-point" class="member">
  1436. <div class="member-link">
  1437. <a name="modulo-point" href="#modulo-point"><tt><b>modulo</b>(point)</tt></a>
  1438. </div>
  1439. <div class="member-description hidden">
  1440. <div class="member-text">
  1441. <p>The modulo operator returns the integer remainders of dividing the point by the supplied value as a new point.</p>
  1442. <ul class="member-list">
  1443. <h4>Parameters:</h4>
  1444. <li>
  1445. <tt>point:</tt>
  1446. <a href="../classes/Point.html"><tt>Point</tt></a>
  1447. </li>
  1448. </ul>
  1449. <ul class="member-list">
  1450. <h4>Returns:</h4>
  1451. <li>
  1452. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the integer remainders of dividing the points by each other as a new point
  1453. </li>
  1454. </ul>
  1455. <h4>Example:</h4>
  1456. <pre><code>var point = new Point(12, 6);
  1457. console.log(point % new Point(5, 2)); // {x: 2, y: 0}</code></pre>
  1458. </div>
  1459. </div>
  1460. </div>
  1461. </div>
  1462. <div class="reference-members">
  1463. <h2>Static Methods</h2>
  1464. <div id="min-point1-point2" class="member">
  1465. <div class="member-link">
  1466. <a name="min-point1-point2" href="#min-point1-point2"><tt><b>Point.min</b>(point1, point2)</tt></a>
  1467. </div>
  1468. <div class="member-description hidden">
  1469. <div class="member-text">
  1470. <p>Returns a new point object with the smallest <a href="../classes/Point.html#x"><tt>x</tt></a> and <a href="../classes/Point.html#y"><tt>y</tt></a> of the supplied points.</p>
  1471. <ul class="member-list">
  1472. <h4>Parameters:</h4>
  1473. <li>
  1474. <tt>point1:</tt>
  1475. <a href="../classes/Point.html"><tt>Point</tt></a>
  1476. </li>
  1477. <li>
  1478. <tt>point2:</tt>
  1479. <a href="../classes/Point.html"><tt>Point</tt></a>
  1480. </li>
  1481. </ul>
  1482. <ul class="member-list">
  1483. <h4>Returns:</h4>
  1484. <li>
  1485. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the newly created point object
  1486. </li>
  1487. </ul>
  1488. <h4>Example:</h4>
  1489. <pre><code>var point1 = new Point(10, 100);
  1490. var point2 = new Point(200, 5);
  1491. var minPoint = Point.min(point1, point2);
  1492. console.log(minPoint); // {x: 10, y: 5}</code></pre>
  1493. <h4>Example:<span class="description">Find the minimum of multiple points:</span></h4>
  1494. <pre><code>var point1 = new Point(60, 100);
  1495. var point2 = new Point(200, 5);
  1496. var point3 = new Point(250, 35);
  1497. [point1, point2, point3].reduce(Point.min) // {x: 60, y: 5}</code></pre>
  1498. </div>
  1499. </div>
  1500. </div>
  1501. <div id="max-point1-point2" class="member">
  1502. <div class="member-link">
  1503. <a name="max-point1-point2" href="#max-point1-point2"><tt><b>Point.max</b>(point1, point2)</tt></a>
  1504. </div>
  1505. <div class="member-description hidden">
  1506. <div class="member-text">
  1507. <p>Returns a new point object with the largest <a href="../classes/Point.html#x"><tt>x</tt></a> and <a href="../classes/Point.html#y"><tt>y</tt></a> of the supplied points.</p>
  1508. <ul class="member-list">
  1509. <h4>Parameters:</h4>
  1510. <li>
  1511. <tt>point1:</tt>
  1512. <a href="../classes/Point.html"><tt>Point</tt></a>
  1513. </li>
  1514. <li>
  1515. <tt>point2:</tt>
  1516. <a href="../classes/Point.html"><tt>Point</tt></a>
  1517. </li>
  1518. </ul>
  1519. <ul class="member-list">
  1520. <h4>Returns:</h4>
  1521. <li>
  1522. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the newly created point object
  1523. </li>
  1524. </ul>
  1525. <h4>Example:</h4>
  1526. <pre><code>var point1 = new Point(10, 100);
  1527. var point2 = new Point(200, 5);
  1528. var maxPoint = Point.max(point1, point2);
  1529. console.log(maxPoint); // {x: 200, y: 100}</code></pre>
  1530. <h4>Example:<span class="description">Find the maximum of multiple points:</span></h4>
  1531. <pre><code>var point1 = new Point(60, 100);
  1532. var point2 = new Point(200, 5);
  1533. var point3 = new Point(250, 35);
  1534. [point1, point2, point3].reduce(Point.max) // {x: 250, y: 100}</code></pre>
  1535. </div>
  1536. </div>
  1537. </div>
  1538. <div id="random" class="member">
  1539. <div class="member-link">
  1540. <a name="random" href="#random"><tt><b>Point.random</b>()</tt></a>
  1541. </div>
  1542. <div class="member-description hidden">
  1543. <div class="member-text">
  1544. <p>Returns a point object with random <a href="../classes/Point.html#x"><tt>x</tt></a> and <a href="../classes/Point.html#y"><tt>y</tt></a> values between <code>0</code> and <code>1</code>.</p>
  1545. <ul class="member-list">
  1546. <h4>Returns:</h4>
  1547. <li>
  1548. <tt><a href="../classes/Point.html"><tt>Point</tt></a></tt>&nbsp;&mdash;&nbsp;the newly created point object
  1549. </li>
  1550. </ul>
  1551. <h4>Example:</h4>
  1552. <pre><code>var maxPoint = new Point(100, 100);
  1553. var randomPoint = Point.random();
  1554. // A point between {x:0, y:0} and {x:100, y:100}:
  1555. var point = maxPoint * randomPoint;</code></pre>
  1556. </div>
  1557. </div>
  1558. </div>
  1559. </div>
  1560. <!-- =========================== copyright notice ========================== -->
  1561. <p class="footer">
  1562. Paper.js v0.12.15<br>
  1563. Copyright &#169; 2011—2021 <a href="http://www.lehni.org" target="_blank">J&uuml;rg Lehni</a> &amp; <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
  1564. <div class="content-end"></div>
  1565. </article>
  1566. </body>