On Mon, 2002-09-23 at 13:01, Kerry Seibold wrote:
> Hello to the PERL people,
> I am looking for some PERL code to use to do some calculations for arcs in a
> cartesian coordinate system.
> Given x,y for arc direction (CW or CCW), arc start point, arc end point, and
> arc centre, I want to calculate xmax, ymax, xmin, ymin.
> The arc can start in any quadrant and end in any quadrant.
> I also want to calculate arc length.
> I have searched on CPAN but can't find what I'm looking for.
> Can you point me in the right direction?

ergh. Time and time again I find myself wishing I could remember high
school maths. I doubt you'll find a perl module for exactly this
purpose, it's pretty specific.

Perl has all the trig functions as builtins so it should be easy enough
to write yourself.

It shouldn't matter if it's CW or CCW, should it? likewise, quadrants
shouldn't matter, sin and cos (and hence tan) are defined in all
quadrants. Arc length can be determined from Pythagorus' theorem (or the
"distance formula" or some other perversion of it).

If someone can remind me of the maths I can write the perl :)

Sorry I can't be more help but just thought I'd write and say you're
probably wasting your time on CPAN.

James.

-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to