On 7 Jul, 2012, at 8:10 AM, William Squires <wsqui...@satx.rr.com> wrote:

>  Okay, I see in the doc set that you can perform an NSAffineTransform on an 
> NSBezierPath, but how do I perform a rotation of the NSBezierPath about an 
> arbitrary CGPoint and with a specified angle in radians? Is this something 
> deep in CoreGraphics, or CoreAnimation? If not, I can do the trigonometry 
> myself if I can get the list of points that make up the NSBezierPath, but it 
> seems these aren't exposed, only NSBezierPathElement objects. Help!

Make one affine transform which translates the point you want to rotate around 
to the origin, rotates, then translates it back. Just use the NSAffineTransrorm 
functions to concatenate the three operations and apply it. 

>  Also, what is the formula for calculating the area of an arbitrary triangle 
> defined by three non-collinear points in 2D space? (i.e. I can't assume the 
> triangle even has a 90 degree angle in it, or any other such shortcuts…)

Google it, I just did. There's 100s of answers. Pick the one which suits you 
best. 

>  Finally, If an NSBezierPath consisting of a closed circuit of points:
> 
> …
> NSBezierPath *mySquarePath = [NSBezierPath bezierPath];
> 
> [mySquarePath setLineWidth:1.0];
> [mySquarePath moveToPoint:CGPointMake(0.0, 0.0)];
> [mySquarePath lineToPoint:CGPointMake(10.0, 0.0)];
> [mySquarePath lineToPoint:CGPointMake(10.0, 10.0)];
> [mySquarePath lineToPoint:CGPointMake(0.0, 10.0)];
> [mySquarePath closePath];
> …
> 
> will [mySquarePath containsPoint:CGPointMake(5.0, 5.0)] return YES even 
> before I fill or stroke the path, or do I have to fill the path first?
> 
> 

Yes it will return YES. Why not just write the code and confirm it for 
yourself. 

> 

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to