p5.js-website icon indicating copy to clipboard operation
p5.js-website copied to clipboard

Fix explanation about curvePoints

Open MarcusCheecham opened this issue 10 months ago • 1 comments

Increasing Access

Unsure

Most appropriate sub-area of p5.js?

Reference

Feature request details

Change Parameter explination under curvePoint() from:

Parameters

a Number: coordinate of first anchor point. b Number: coordinate of first control point. c Number: coordinate of second control point. d Number: coordinate of second anchor point. t Number: amount to interpolate between 0 and 1.

To Newer version:

Parameters

a Number: coordinate of first control point. b Number: coordinate of first anchor point. c Number: coordinate of second anchor point. d Number: coordinate of second control point. t Number: amount to interpolate between 0 and 1.

Reasoning

Under curve() they use:

curve(x1, y1, x2, y2, x3, y3, x4, y4) -- x1 ------ y1------ x2 --- y2 ----- x3 ----- y3 ----- x4 ----- y4 control, control, anchor anchor, anchor, anchor, control, control

curvePoint() uses: (If adding a curvePoint() under the X coords)

curvePoint(x1, x2, x3, x4) control, anchor, anchor, control

But in the explanation, they say it uses:

curvePoint(x2, x3, x1, x4) anchor, control, control, anchor

This confused me at first since I am new to programming in JavaScript and would like to help others to try not to confuse them

MarcusCheecham avatar Feb 15 '25 07:02 MarcusCheecham

Hi @MarcusCheecham! The docs on the website here get automatically generated based on the doc comments in the p5.js repo. Could you make your pull request there? For any item in the reference, there's a link at the bottom to the source code that generated it:

Image

Although, we're currently in a slightly abnormal state in that the next release is a big one, p5 2.0, and that lives in a different branch than normal, the dev-2.0 branch, and things have moved around a bit. Here's a link to where curvePoint lives there: https://github.com/processing/p5.js/blob/0b5b745815b53d98da2336a2f42216d84f5ce975/src/shape/curves.js#L768

davepagurek avatar Feb 15 '25 20:02 davepagurek