https://github.com/progfay/p5-cubic-bezier
Cubic bezier with p5
https://github.com/progfay/p5-cubic-bezier
Last synced: 3 months ago
JSON representation
Cubic bezier with p5
- Host: GitHub
- URL: https://github.com/progfay/p5-cubic-bezier
- Owner: progfay
- Created: 2019-10-08T14:39:02.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-10-08T15:18:21.000Z (over 5 years ago)
- Last Synced: 2025-01-30T20:16:05.490Z (5 months ago)
- Language: Processing
- Homepage:
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# p5-cubic-bezier
Cubic bezier with p5
## Usage
```java
final int SAMPLE = 500;void setup () {
size(500, 500);
background(0);
stroke(-1);CubicBezier bezier = new CubicBezier(0.42, 0, 0.58, 1);
for (int i = 0; i < SAMPLE; i++) {
float x = (float) ((double) width / SAMPLE * i);
float y = (float) (height - bezier.solve((double) i / SAMPLE) * height);
point(x, y);
}
}
```