finding uniformly spaced points on Arc2D

J

Jeff Higgins

Hi,
I would like to use java.awt.geom.Arc2D.Double
to draw an arc. I would now like to draw tic marks
onto the arc at uniformly spaced points.

Can someone explain how I might find the uniformly
spaced points on the arc?

Thanks,
Jeff Higgins
 
A

Andrew Thompson

Jeff said:
Can someone explain how I might find the uniformly
spaced points on the arc?

Do you mean points that are an equal distance apart
for an hypothetical traveller following the path, or points
that are equally distant 'as the crow flies' (in a straight
line from point A to point B)?

Note that your words imply the second, but an arc
might have any number of points that are 'uniformly
spaced' from any given point.

Andrew T.
 
J

Jeff Higgins

Andrew said:
Do you mean points that are an equal distance apart
for an hypothetical traveller following the path, or points
that are equally distant 'as the crow flies' (in a straight
line from point A to point B)?
Hi Andrew,
Sorry for being unclear. Equal distance apart, as
in the traveller. I'm attempting to draw a scale, much
like the scale of a voltmeter.

Thanks for any help you can give me,
Jeff Higgins
 
G

Googmeister

Jeff said:
Hi,
I would like to use java.awt.geom.Arc2D.Double
to draw an arc. I would now like to draw tic marks
onto the arc at uniformly spaced points.

Can someone explain how I might find the uniformly
spaced points on the arc?

It's an arc of a circle, say of d degrees. Just divide
the arc into segments of d/n degrees to get n+1
equally spaced points (both as-the-crow-flies
and as-the-traveler-walks).
 
J

John Ersatznom

Googmeister said:
It's an arc of a circle, say of d degrees. Just divide
the arc into segments of d/n degrees to get n+1
equally spaced points (both as-the-crow-flies
and as-the-traveler-walks).

Equally-spaced both ways, but not quite the same distances. For a
subtended angle of theta between successive ticks and a radius of rho
for the full circle, the traveller walks a distance of

rho*theta

while the crow flies only

rho*sqrt((cos(theta) - 1)^2 + sin(theta)^2)

Note that the latter square root is of

cos^2(theta) + sin^2(theta) - 2cos(theta) + 1

which equals

2 - 2cos(theta)

so the crow flies rho*sqrt(2 - 2cos(theta))

I leave proving sqrt(2 - 2cos(theta)) < theta as an exercise for the reader.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top