filling in a code that draws a circle (need help ASAP)

I am filling in a function that draws circles on the screen. I need to write a loop that goes from 0 to bits.length, and inside the loop, I need to set 2 different colors using strokeStyle and fillStyle. The function is called drawBits()

drawBits()
Your question sounds like it's leaving out a LOT of needed details. You don't give enough information.

In general though, to know if a point is inside a circle, you need to check if the point falls within the radius of the circle.
If the equation of the circle is x^2 + y^2 = R^2, then you need to check if the magnitude of some point (Px, Py) is less than R.

sqrt(Px^2 + Py^2) must be < R
AKA
Px^2 + Py^2 must be < R^2
Last edited on
Topic archived. No new replies allowed.