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

Clarifying default parameter angle mode for trig functions like sin() and cos() #671

Open
thrly opened this issue Jan 4, 2025 · 4 comments · May be fixed by processing/p5.js#7475
Open
Assignees

Comments

@thrly
Copy link

thrly commented Jan 4, 2025

Topic

Currently the parameter details for trig functions like sin(), cos(), asin() etc., say:

* @param {Number} angle the angle.

In the description for those functions, its noted that the function 'takes into account the current angleMode()'. They don't state the default expectation that it's radians. The reference for angleMode() does: 'Functions such as rotate() and sin() expect angles measured radians by default.'

It's okay as it is, but would it be clearer for each of the trig functions' parameters that say 'angle: the angle' to clarify that by default its expecting a radian value, without new users needing to check the default state of angleMode()?

Maybe something like:

angle the angle, in radians unless specified by angleMode().

I would be happy to work on this if it's an issue worth fixing.

@limzykenneth
Copy link
Member

@thrly I think that's a good idea, you can go ahead and file a PR for it, we can discuss exact wording in the PR.

@thrly
Copy link
Author

thrly commented Jan 14, 2025

Great, I'll work on it this week. Do I need to be assigned before I submit the PR?

@thrly
Copy link
Author

thrly commented Jan 18, 2025

Hi, can I clarify something @limzykenneth ? I've made the changes to the p5.js source code in src/math/trigonometry.js following the contributer docs, but I've just realised this issue is in the p5.js-website repo, not the main p5.js source repository. In my pull request, I'm not sure if I can 'resolve' an issue that's technically from another repo?

Should I have made this issue over in the p5-js repo to start with?

Sorry, this is my first contribution. I'm learning but trying to be careful.

@limzykenneth
Copy link
Member

@thrly No that is correct, changes to the reference content should be made in the inline reference in the p5.js source code repository. The version in the website repo is updated automatically from that.

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

Successfully merging a pull request may close this issue.

2 participants