Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mapbox/unitbezier

Package Overview
Dependencies
Maintainers
14
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mapbox/unitbezier

unit bezier curve interpolation

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.6M
increased by13.34%
Maintainers
14
Weekly downloads
 
Created

What is @mapbox/unitbezier?

@mapbox/unitbezier is a JavaScript library for working with unit Bezier curves. It allows you to create and manipulate cubic Bezier curves, which are commonly used in animations and transitions in web development.

What are @mapbox/unitbezier's main functionalities?

Creating a UnitBezier instance

This feature allows you to create a new instance of a UnitBezier curve by specifying the control points. The control points determine the shape of the Bezier curve.

const UnitBezier = require('@mapbox/unitbezier');
const bezier = new UnitBezier(0.42, 0, 0.58, 1);

Solving for X given T

This feature allows you to solve for the X coordinate of the Bezier curve given a parameter T. This is useful for animations where you need to determine the position of an element at a specific point in time.

const x = bezier.solve(0.5, UnitBezier.prototype.epsilon);

Solving for Y given T

This feature allows you to solve for the Y coordinate of the Bezier curve given a parameter T. Similar to solving for X, this is useful for determining the vertical position of an element in an animation.

const y = bezier.solve(0.5, UnitBezier.prototype.epsilon, 'y');

Other packages similar to @mapbox/unitbezier

Keywords

FAQs

Package last updated on 22 Oct 2021

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

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