arc() silently fails with Infinity/NaN values ( no console warnings)
Open
@Homaid is already working on this.
Since Oct 25, 2025.
Area:Core
Bug
Friendly Errors
Required for p5v1 Freeze
- Dominant language
- JavaScript
- Stars
- 24k
- Forks
- 3.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 25
Description
Most appropriate sub-area of p5.js?
- Accessibility
- Color
- Core/Environment/Rendering
- Data
- DOM
- Events
- Image
- IO
- Math
- Typography
- Utilities
- p5.strands
- WebGL
- DevOps, Build process, Unit testing
- Internationalization (i18n)
- Friendly Errors
- Other (specify if possible)
p5.js version
1.11.1
Web browser and version
Chrome 138.0.0.0 (64-bit)
Operating system
windows 11
Steps to reproduce this
Steps:
- Open https://editor.p5js.org/
- Paste the following code into the editor.
- Observe that no console warnings appear, even though invalid parameters are passed to
arc().
Snippet:
function setup() {
createCanvas(400, 400);
strokeWeight(2);
}
function draw() {
background(220);
// Extreme / invalid values
arc(100, 100, 80, 80, 0, 1000); // Huge end angle
arc(200, 100, 80, 80, -1000, 1000); // Huge range
arc(300, 100, 80, 80, Infinity, Infinity); // Infinity inputs
arc(100, 200, 80, 80, NaN, PI); // NaN value
arc(200, 200, -80, -80, 0, PI); // Negative radius
arc(300, 200, Infinity, Infinity, 0, PI); // Infinite radius
print("Frame:", frameCount);
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.