Skip navigation.
 
mlRe: NSBezierPath: angle of a line
FROM : Scott Thompson
DATE : Wed Apr 13 16:39:23 2005

On Apr 12, 2005, at 6:08 PM, Ian was here wrote:

> I have a straight line created using an NSBezierPath.
> This line has a point of origin that remains fixed,
> and a current point that can be moved around it's
> origin, changing the shape and size of the line.
>
> The issue I'm having is finding the angle of the line
> as it's current point is moving around it's origin.
> Does anyone know how to get the angle of a line?


atan2(y2-y1,x2-x1)

The resulting angle will be in radians.  To convert radians to 
degrees multiply by 180/pi

Related mailsAuthorDate
mlNSBezierPath: angle of a line Ian was here Apr 13, 01:08
mlRe: NSBezierPath: angle of a line Henry McGilton Apr 13, 01:46
mlRe: NSBezierPath: angle of a line Scott Thompson Apr 13, 16:39
mlRe: NSBezierPath: angle of a line Ian was here Apr 13, 21:36