Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6971421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:50:17+00:00 2026-05-27T16:50:17+00:00

I was writing some canvas code to draw a circle, but it never got

  • 0

I was writing some canvas code to draw a circle, but it never got painted. At last I found out it was because I had typed Math.Pi instead of Math.PI.

In Chrome Dev Tools I could see that Math.Pi was undefined, but it never threw any exceptions. Is this a bug in Chrome or is it actually legal to do calculations on undefineds?

Here is my code:

ctx.save();
ctx.lineWidth = 2;
ctx.fillStyle = '#FF0000';
ctx.beginPath();
ctx.arc(can.x, can.y, 15, 0, Math.Pi * 2, true);
ctx.fill();
ctx.restore();

ctx refers to canvas.getContext("2d");.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T16:50:17+00:00Added an answer on May 27, 2026 at 4:50 pm

    undefined * 2 evaluates to NaN, and the canvas 2D context specification says:

    Except where otherwise specified, for the 2D context interface, any method call with a numeric argument whose value is infinite or a NaN value must be ignored.

    So, a ctx.arc call with an argument of NaN means that the call is silently ignored (i.e. nothing is drawn), rather than an error is thrown.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Writing some XML documentation for a predicate helper class. But I can't figure out
I was writing some code in C#, and I found myself writing: return new
While writing some C code, I decided to compile it to assembly and read
I am writing some code to determine whether a network domain is registered. For
So I was writing some code today that basically looks like this: string returnString
Say I'm writing some ruby code and I want to use the standard Date
I'm writing some semi-portable code and want to be able to detect when I'm
In writing some tests for a project I'm working on, I found that the
While writing some code i came across this issue: #include <iostream> class random {
In writing some threaded code, I've been using the ReaderWriterLockSlim class to handle synchronized

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.