Am Donnerstag 20 Januar 2005 21:56 schrieb Curtis L. Olson:
> This is kind of off today's topic, but I have an unrelated question.
>
> Working in 2d space, given 3 points, I know how to compute a circle
> (center/radius) that passes through those three points.  Now I need to
> compute the direction of curvature of the 3 points.  In other words,
> moving from the 1st point through the second point to the 3rd point, is
> the direction of the circle clockwise (curving right) or counter
> clockwise (curving left.)

Just take the cross product of the vectors 1->2 and 1->3 (any 2 vectors will 
work, if you ensure a consistent selection). This should give a vector of the 
form (0 0 z). The sign of z gives the rotation direction.

Since this is a special case this simplifies to:

dx1 = x2 - x1
dx2 = x3 - x1
dy1 = y2 - y1
dy2 = y3 - y1

z = dx1*dy2 - dx2*dy1

Thomas

_______________________________________________
Flightgear-devel mailing list
[email protected]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to