🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

curve-utils

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

curve-utils

## Installation

0.0.2
latest
npm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

curve utils

Installation

npm install curve-utils --save
<script src="js/curveUtils.js"></script>

curve

Features

curve functions.you can get the little step of the given path,so you can draw the animated curve. 贝塞尔曲线函数,画贝塞尔曲线动画

inputContent like inputString:"M0 0L100 0" or inputArray:[["M",0,0],["L",100,0]]

inputString: "M0 0L100 0";
inputArray: [
  ["M", 0, 0],
  ["L", 100, 0]
];

Methonds

path2Curve: format the path to curve.

path2Curve(path: inputContent): inputArray;

getTotalLength: get total length of the curve

getTotalLength(path: inputContent): number;

getPointAtLength: get point at the given length along the given path

getPointAtLength(path: inputContent, length: number): {
x: number;
y: number;
};

getSubpathsAtLength:get the subpath of a given path at the given range[0,1];

getSubpathsAtLength(path: string|CurveObject[], ratio: number,justStart:boolean);
  • justStart:true; returns {start:string like "M0 0 C0 0 100 0 100 0",end:""}

  • justStart:false; returns string like "M0 0 C0 0 100 0 100 0"

martix

let mat = martix | new Martix(1, 0, 0, 1, 0, 0);

Methonds

translate(x,y)

ratate(deg,x,y)

scale(x,y,cx,cy)

...

FAQs

Package last updated on 03 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts