UNPKG

cornerstone-math

Version:

Math and computation geometry functionality for cornerstone

494 lines (139 loc) 6.31 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Global - Documentation</title> <script src="scripts/prettify/prettify.js"></script> <script src="scripts/prettify/lang-css.js"></script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc.css"> </head> <body> <input type="checkbox" id="nav-trigger" class="nav-trigger" /> <label for="nav-trigger" class="navicon-button x"> <div class="navicon"></div> </label> <label for="nav-trigger" class="overlay"></label> <nav> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Line3.html">Line3</a></li><li><a href="Plane.html">Plane</a></li></ul><h3>Global</h3><ul><li><a href="global.html#approximatelyEquals">approximatelyEquals</a></li><li><a href="global.html#findClosestPoint">findClosestPoint</a></li></ul> </nav> <div id="main"> <h1 class="page-title">Global</h1> <section> <header> <h2> </h2> </header> <article> <div class="container-overview"> <dl class="details"> </dl> </div> <h3 class="subsection-title">Methods</h3> <h4 class="name" id="approximatelyEquals"><span class="type-signature"></span>approximatelyEquals<span class="signature">(a, b, epsilon)</span><span class="type-signature"> &rarr; {boolean}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="math.js.html">math.js</a>, <a href="math.js.html#line37">line 37</a> </li></ul></dd> </dl> <div class="description"> Compare if two numbers are equal(if they have approximately the same value). to prevent js float precision issue Adapted from glmatrix </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>a</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>b</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>epsilon</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last">Precision to define proximity</td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="param-desc"> check whether or not the arguments have approximately the same value </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">boolean</span> </dd> </dl> <h4 class="name" id="findClosestPoint"><span class="type-signature"></span>findClosestPoint<span class="signature">(sources, target)</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="point.js.html">point.js</a>, <a href="point.js.html#line52">line 52</a> </li></ul></dd> </dl> <div class="description"> Returns the closest source point to a target point given an array of source points. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>sources</code></td> <td class="type"> </td> <td class="description last">An Array of source Points</td> </tr> <tr> <td class="name"><code>target</code></td> <td class="type"> </td> <td class="description last">The target Point</td> </tr> </tbody> </table> <h5>Returns:</h5> <div class="param-desc"> Point The closest point from the points array </div> </article> </section> </div> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.6</a> using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. </footer> <script>prettyPrint();</script> <script src="scripts/linenumber.js"></script> </body> </html>