Adding some polar coordinate capabilities to NSBezierPath.
Adding some polar coordinate capabilities to NSBezierPath.
- Subject: Adding some polar coordinate capabilities to NSBezierPath.
- From: "John C. Randolph" <email@hidden>
- Date: Mon, 15 Oct 2001 06:11:45 -0700
After attending a lecture by Dan Ingalls last week, I was somewhat
intrigued by the classic turtle-graphics figures that the smalltalkers
used to do for demos. The upshot is, I'm writing a category on
NSBezierPath, like this:
@interface NSBezierPath (turtleGraphicsAdditions)
- (void) moveWithHeading:(float) angle distance:(float) distance;
- (void) lineWithHeading:(float) angle distance:(float) distance;
@end
..but I'm not entirely happy with these method names. I've considered
making it
- (void) relativeMoveToRho:(float) rho theta:(float) theta;
- (void) relativeLineToRho:(float) rho theta:(float) theta;
where rho and theta are a polar offset from the path's current point,
and adding
- (void) moveToRho:(float) rho theta:(float) theta;
- (void) lineToRho:(float) rho theta:(float) theta;
where rho and theta are a polar offset from the origin.
This code will end up in the MiscKit, so I thought I'd solicit the
group's opinion. Should the naming lean more toward English, or
Geometry?
-jcr
"I fear all we have done is to awaken a sleeping giant and fill him with
a terrible resolve." -Admiral Isoroku Yamamoto, Dec 7, 1941.