New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

line-interpolate-points

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

line-interpolate-points - npm Package Compare versions

Comparing version 0.0.4 to 1.0.0

2

package.json
{
"name": "line-interpolate-points",
"version": "0.0.4",
"version": "1.0.0",
"description": "Exposes a function to interpolate any number of points along a multi-segment line (LineString).",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -13,3 +13,3 @@ [![NPM](https://nodei.co/npm/line-interpolate-points.png?downloads=true&stars=true)](https://nodei.co/npm/line-interpolate-points/)

The module exports a single function, `interpolateLineRange( ctrlPoints, number )`; `ctrlPoints` is an array of 2D
point objects, like `[ { x: 5, y: 10 }, { x: 7, y: 10 }, { x: 14, y: 13 } ]`, while `number` is the number of points to
point arrays, like `[ [ 5, 10 ], [ 7, 10 ], [ 14, 13 ] ]`, while `number` is the number of points to
interpolate (the endpoints included).

@@ -19,10 +19,9 @@

> var interpolateLineRange = require( 'line-interpolate-points' )
> interpolateLineRange( [ { x: 3, y: 10 }, { x: 4, y: 10 } ], 2 )
[ { x: 3, y: 10 },
{ x: 4, y: 10 } ]
> interpolateLineRange( [ { x: 3, y: 10 }, { x: 4, y: 10 } ], 4 )
[ { x: 3, y: 10 },
{ x: 3.3333333333333335, y: 10 },
{ x: 3.666666666666667, y: 10 },
{ x: 4, y: 10 } ]
> interpolateLineRange( [ [ 3, 10 ], [ 4, 10 ] ], 2 )
[ [ 3, 10 ], [ 4, 10 ] ]
> interpolateLineRange( [ [ 3, 10 ], [ 4, 10 ] ], 4 )
[ [ 3, 10 ],
[ 3.3333333333333335, 10 ],
[ 3.666666666666667, 10 ],
[ 4, 10 ] ]
```

@@ -38,4 +37,4 @@

Please fork and pull request against upstream master on a feature branch. Pretty please: provide unit tests and script
fixtures in the `test` directory.
Please fork and pull request against upstream master on a feature branch. Please provide unit tests and script fixtures
in the `test` directory.

@@ -42,0 +41,0 @@ ### Running Unit Tests

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc