https://github.com/retraigo/curves
Functions to generate various curves in TypeScript
https://github.com/retraigo/curves
Last synced: 3 months ago
JSON representation
Functions to generate various curves in TypeScript
- Host: GitHub
- URL: https://github.com/retraigo/curves
- Owner: retraigo
- License: mit
- Created: 2023-07-05T05:45:47.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-30T11:04:03.000Z (8 months ago)
- Last Synced: 2025-02-15T19:24:59.969Z (5 months ago)
- Language: TypeScript
- Size: 18.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# curves
Functions to generate various curves in TypeScript## Example
Generate a cubic bezier:
```ts
import { svgChart, cubicBezier } from "@retraigo/curve";const pts = cubicBezier(20, .17, .67, .83, .67)
const x = pts.map(x => x[0])
const y = pts.map(x => x[1])// Plot the points on a 100 x 100 scatter chart
const svg = svgChart(x, y, [100, 100], true, .1)Deno.writeTextFile("bezier.svg", svg)
```