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

Corrects the circle() description #7110

Merged
merged 2 commits into from
Jul 3, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/core/shape/2d_primitives.js
Original file line number Diff line number Diff line change
Expand Up @@ -490,12 +490,10 @@ p5.prototype.ellipse = function(x, y, w, h, detailX) {
/**
* Draws a circle.
*
* A circle is a round shape defined by the `x`, `y`, and `d`
* parameters. `x` and `y` set the location of its center. `d` sets its
* width and height (diameter). Every point on the circle's edge is the
* same distance, `d`, from its center. See
* <a href="#/p5/ellipseMode">ellipseMode()</a> for other ways to set
* its position.
* A circle is a round shape defined by the `x`, `y`, and `d` parameters.
* `x` and `y` set the location of its center. `d` sets its width and height (diameter).
* Every point on the circle's edge is half the distance, `d`, from its center (radius = diameter/2).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch @JulioGitLab! What do you think about the following?

Every point on the circle's edge is the same distance, 0.5 * d, from its center. 0.5 * d (half the diameter) is the circle's radius.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nickmcintyre! I think your way of explaining it is easier to understand. Let's use it!

* See <a href="#/p5/ellipseMode">ellipseMode()</a> for other ways to set its position.
*
* @method circle
* @param {Number} x x-coordinate of the center of the circle.
Expand Down
Loading