UNPKG

230 BPlain TextView Raw
1import { midPoint } from '../util/mid-point';
2
3export const lineToCubic = (x1: number, y1: number, x2: number, y2: number) => {
4 const t = 0.5;
5 const mid = midPoint([x1, y1], [x2, y2], t);
6 return [...mid, x2, y2, x2, y2];
7};