processing / processing/p5.js

arc() silently fails with Infinity/NaN values ( no console warnings)

Open
#8,198 4 comments 0 reactions 1 assignee View on GitHub

@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:
  1. Open https://editor.p5js.org/
  2. Paste the following code into the editor.
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.