Re: Adding some polar coordinate capabilities to NSBezierPath.
Re: Adding some polar coordinate capabilities to NSBezierPath.
- Subject: Re: Adding some polar coordinate capabilities to NSBezierPath.
- From: "Marco Scheurer" <email@hidden>
- Date: Mon, 15 Oct 2001 16:10:51 +0200
On Mon, 15 Oct 2001 06:11:45 -0700
"John C. Randolph" <email@hidden> wrote:
>
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;
>
>
Should the naming lean more toward English, or Geometry?
In that case, I would say english. Rho and theta to express
polar coordinates is not universal, certainly less so than x
and y for cartesian. For instance, I've used (r, theta) much
more often than (rho, theta).
Is it possible to split rotation and movement? That would
make the names easier:
- (void) turnByAngle:(float) angle;
- (void) turnToDirection:(float) angle;
- (void) moveToDistance:(float) distance;
marco
Marco Scheurer
Sen:te, Lausanne, Switzerland
http://www.sente.ch