0.4.3 • Published 2 months ago

@curvy/catmull-rom v0.4.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

@curvy/catmull-rom

Cubic Catmull Rom splines pass through each of their control points except the first and last point. The way they pass through these points is at a fixed level of tension

Basic Example

import { createCubicCardinalSpline } from '@curvy/catmull-rom'

const catmullRomSpline = createCubicCardinalSpline([
  // This point is not passed through
  {x: -1, y: 0},

  // These points are passed through
  {x: 0, y: 0},
  {x: 0.5, y: 0.5},
  {x: 1, y: 1},

  // This point is not passed through
  {x: 2, y: 1}
])

catmullRomSpline.solveT(0)
// equals { x: 0, y: 0 }

catmullRomSpline.solve({x: 1})
// equals { x: 1, y: 1 }
0.4.3

2 months ago

0.3.0

1 year ago

0.4.1

1 year ago

0.4.0

1 year ago

0.2.2

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.5

1 year ago