?
Solved

angle clockwise or counterclockwise?

Posted on 2010-11-13
4
Medium Priority
?
793 Views
Last Modified: 2012-05-10
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!

0
Comment
Question by:Emilie
  • 2
4 Comments
 
LVL 85

Accepted Solution

by:
ozo earned 1500 total points
ID: 34129463
Take the cross product of the vectors
0
 

Author Comment

by:Emilie
ID: 34129483
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?
0
 

Author Closing Comment

by:Emilie
ID: 34129817
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
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Nicole
This is a research brief on the potential colonization of humans on Mars.
Lithium-ion batteries area cornerstone of today's portable electronic devices, and even though they are relied upon heavily, their chemistry and origin are not of common knowledge. This article is about a device on which every smartphone, laptop, an…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Suggested Courses
Course of the Month13 days, 8 hours left to enroll

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question