UNPKG

shape-points

Version:

Generate points for simple shapes and curves: arcs, rectangles, rounded rectangles, circles, ellipses, bezierCurveTo, bezierCurveThrough (i.e., bezier curves through specific points)

537 lines (171 loc) 8.36 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Module: shape-points/bezierCurveTo</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-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Module: shape-points/bezierCurveTo</h1> <section> <header> </header> <article> <div class="container-overview"> <div class="description"><p>Calculate points for a bezier curve with a starting point and two control points from https://stackoverflow.com/a/15399173/1955997</p></div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>x1</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>starting point (usually a moveTo)</p></td> </tr> <tr> <td class="name"><code>y1</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>starting point</p></td> </tr> <tr> <td class="name"><code>cp1x</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>first control point</p></td> </tr> <tr> <td class="name"><code>cp1y</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>first control point</p></td> </tr> <tr> <td class="name"><code>cp2x</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>second control point</p></td> </tr> <tr> <td class="name"><code>cp2y</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>second control point</p></td> </tr> <tr> <td class="name"><code>x2</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>ending point</p></td> </tr> <tr> <td class="name"><code>y2</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>ending point</p></td> </tr> <tr> <td class="name"><code>pointsInArc</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> 5 </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="bezierCurveTo.js.html">bezierCurveTo.js</a>, <a href="bezierCurveTo.js.html#line1">line 1</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>[x1, y1, x2, y2, ... xn, yn]</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">array</span> </dd> </dl> </div> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-shape-points.html">shape-points</a></li><li><a href="module-shape-points_arc.html">shape-points/arc</a></li><li><a href="module-shape-points_bezierCurveThrough.html">shape-points/bezierCurveThrough</a></li><li><a href="module-shape-points_bezierCurveTo.html">shape-points/bezierCurveTo</a></li><li><a href="module-shape-points_circle.html">shape-points/circle</a></li><li><a href="module-shape-points_ellipse.html">shape-points/ellipse</a></li><li><a href="module-shape-points_line.html">shape-points/line</a></li><li><a href="module-shape-points_quadraticCurveTo.html">shape-points/quadraticCurveTo</a></li><li><a href="module-shape-points_rect.html">shape-points/rect</a></li><li><a href="module-shape-points_roundedRect.html">shape-points/roundedRect</a></li></ul> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Tue Mar 29 2022 14:31:03 GMT-0700 (Pacific Daylight Time) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>