This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

Dear experts,

There is a closed cutve consisting of 12 x,y points. How can I know that curve is in clockwise or anticlockwise direction?

Please help me. It's urgent.

Thanks.

There is a closed cutve consisting of 12 x,y points. How can I know that curve is in clockwise or anticlockwise direction?

Please help me. It's urgent.

Thanks.

Yes, by plotting the curve on paper I can know the curve direction, but I'm making a project in c++ to convert a 2D image in 3D. In that I'm facing this problem so I need a routine to know curve direction.

any idea?

Thanks.

1. connect the dots.

2. draw a vertical line to the one of the segments.

3. if the vertical line crosses the curve odd number of times to the right then it's a clockwise, if it crosses odd number of times to the left, it counterclockwise.

______

/ \

^ |------|----

\______/

the ^ shows the real direction

the ---- line is the vertical line

sorry for the too simplified drawing.

good luck

If that is your intention, then can you not simply take account of the co-ordinates that you are plotting? For a 2D curve, if

x is increasing, while y is decreasing

OR

x is decreasing and y is increasing

then you are plotting in a clockwise direction, while if

x is increasing while y is increasing

OR

x is decreasing while y is decreasing

then you are plotting in an anti-clokwise direction.

Having said that, the question of whether either x or y is increasing or decreasing would be relative to the origin of the curve!

I think you need to explain a little more what you are after!

btw, is this a homewrok question???

This sounds like a very well known and basic polygon algorithm, assuming curve=polygon otherwise there is no meaning to direction.

The polygon can take any closed shape and it's line can cross itself like the number "8", there are two ways to describe a polygon with the shape of "8", very much like writing it, for example if you start writing it from the bottom point, you can continue to the right or to the left. If you continue drawing to the right you'll get counterclockwise description, continuing to the left will get you clockwise shape.

Hope it was clear.

This method is really working. But when I compute, sum is positive for counterclockwise & negative for clockwise.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.

y0*x1-y1*x0

+y1*x2-y2*x1

+y2*x3-y3*x2

...

+y10*x11-y11*x10

+y11*x0 -y0 *x11

will be positive for clockwize points, and negative for counterclockwize points,

assuming thr curve does not intersect itself