Skip to content

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

Closed
processing/p5.js
#7475
@thrly

Description

@thrly

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions