How to find the center of arc in canvas with JavaScript?
I need to find the position of the arc and it's center.
How to find the center of arc in canvas with JavaScript?
I need to find the position of the arc and it's center.
If your code drew the arc using context.arc(centerX,centerY,radius,startAngle,endAngle)
An arc is defined by its centerpoint, radius, startAngle & endAngle so then you already have the center point: [centerX, centerY]
.
If you didn't draw the arc but just have an image containing different colored arcs
context.getImageData
to fetch all the pixel colors on the canvas.