Link to home
Start Free TrialLog in
Avatar of Emilie
Emilie

asked on

angle clockwise or counterclockwise?

I am writing a program that needs to determine the angle between two line segments and whether the angle is clockwise or counterclockwise from the main segment.

How do I determine the direction of the angle from the main segment?

All the coordinates are positive numbers.  The segments are of variant sizes.

The solution needs to be an equation since I will have to insert it in some code.

Thanks!

ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Emilie
Emilie

ASKER

Math isn't exactly my forte.  Would you mind explaining how to do a cross product of vectors?

Say I have a(x,y), b(x, y) and c(x, y), how do I do the cross product of ab x cb?
Avatar of Emilie

ASKER

The cross product would be

(bx - ax)*(cy - ay) + (by - ay)*(cx - ax)

- x * y yields a positive number
- y * x yields a negative number