Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix explanation about curvePoints #701

Open
MarcusCheecham opened this issue Feb 15, 2025 · 1 comment
Open

Fix explanation about curvePoints #701

MarcusCheecham opened this issue Feb 15, 2025 · 1 comment

Comments

@MarcusCheecham
Copy link

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

@davepagurek
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants