Alexander Solonik
Alexander Solonik

Reputation: 10250

using a value other than 0 for the startAngle of arc method in canvas

canvas's arc method has the following syntax:

void ctx.arc(x, y, radius, startAngle, endAngle, anticlockwise);

I was just playing around with this example HERE.

and I just changed the startAngle to be (MATH.PI * 2 ). Usually people use 0 for that parameter , so what difference does it make whether I use 0 or MATH.PI * 2 ? Can anybody explain ?

Upvotes: 0

Views: 123

Answers (2)

Ahmad T.
Ahmad T.

Reputation: 54

It makes no difference. They can be used interchangeably if you are drawing a complete circle i.e.

2 * Math.PI

Upvotes: 2

Coder55
Coder55

Reputation: 559

the function uses the radian measure - this measure is periodically to 2*MAHT.PI.

So, it makes no difference wheter you use 0, 2*Math.PI or any multiple of it (like 222*Math.PI)

Upvotes: 2

Related Questions