Natural Potato Magnet

    primitive-circle

    1.0.2 • Public • Published

    primitive-circle

    Creates circle geometry

    Usage

    var createCircle = require('primitive-circle')
     
    var circle = createCircle(1, 32)
    //circle = { positions: [[x,y], ...], cells: [[0, 1], [1,2], ...] }

    API

    createCircle(r, segments)

    • r - radius of the circle
    • segments - number of segments the circle will be made of

    Returns geometry object with positions [x, y] and cells [i, j]

    Note: Points will be ordered clock-wise starting at 3pm

    License

    MIT, see LICENSE.md for details.

    Install

    npm i primitive-circle

    DownloadsWeekly Downloads

    12

    Version

    1.0.2

    License

    MIT

    Last publish

    Collaborators

    • vorg