Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

How to get the exact radius of an Arc in Paper.js?

123 views
Skip to first unread message

ANKUR YADAV

unread,
Sep 27, 2024, 12:25:59 AM9/27/24
to Paper.js

I have an arc already created. I want to get the radius of that arc. I tried using the getCurvatureAtTime() method. But it's not giving correct result. Is there any way I can find the exact radius of that curve?

I have tried using this paper sketch. It should give a result of 1 at each location but I'm getting different values at different curve locations.

shishir raven

unread,
Nov 11, 2024, 12:38:37 PM11/11/24
to Paper.js

Hi Ankur,

I wanted to clarify something regarding arcs. While an arc is typically a segment of a circle, it’s important to note that it doesn’t have to be a perfect circle—it could also be part of an ellipse or oval. In that case, the shape would not have a constant radius, as it changes depending on the curvature.

However, by using vector geometry, you can still calculate the distance from any point on the arc to the center point, even if the shape is elliptical.

If you could provide a bit more detail on what you’re trying to achieve, I may be able to assist you further.

I developed counterdraw, a precision tool upon PaperJS. If you need help in coding, I might also be able to help you in that. 
https://iamshishir.com/portfolio/counterdraw/

Thanks and Regards,
Shishir
iamshishir.com

Reply all
Reply to author
Forward
0 new messages