Skip to content

black7375/SplitCubicalBezier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SplitCubicalBezier

This project referenced by StackOverflow:Extrapolate split cubic-bezier to 1,1.

Example

import { presets, createCubicBezier, getSplitCubicBezier } from "split-cubical-bezier";

const linear1 = presets.linear;                    // Same as linear2
const linear2 = createCubicBezier(0, 0, 1, 1);     // createCubicBezier(x1, y1, x2, y2) = { xs: [ 0, 0, 1, 1 ], ys: [ 0, 0, 1, 1 ] }
const results = getSplitCubicBezier(linear2, 0.5); // { left: [ 0, 0, 0.5, 0.5 ], right: [ 0.5, 0.5, 1, 1 ] }