Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Clockwise or in Clockwise angles

Subject: Clockwise or in Clockwise angles

From: Mahsa

Date: 22 Jan, 2014 17:29:08

Message: 1 of 7

Hello,
I have three point in 3D for example=
point1=[-1;0;0]
middlePoint=[0;0;0]
point2=[0;0;-1]

I need a way to give me +90 degree if I give the points in this order
(point1,middlePoint,point2)
and -90 in this order:
(point2;middlePoint,point2)

So I need to make distinguish between clockwise or in clockwise rotation.
Thank you

Subject: Clockwise or in Clockwise angles

From: Roger Stafford

Date: 22 Jan, 2014 20:00:13

Message: 2 of 7

"Mahsa" wrote in message <lbov53$nnk$1@newscl01ah.mathworks.com>...
> Hello,
> I have three point in 3D for example=
> point1=[-1;0;0]
> middlePoint=[0;0;0]
> point2=[0;0;-1]
>
> I need a way to give me +90 degree if I give the points in this order
> (point1,middlePoint,point2)
> and -90 in this order:
> (point2;middlePoint,point2)
>
> So I need to make distinguish between clockwise or in clockwise rotation.
> Thank you
- - - - - - - - -
In three dimensions the notion of clockwise versus counterclockwise loses its meaning. In your example if one looks at the three points from some point along the positive y-axis, clockwise would go from point1 to point2, but if you looked at them from somewhere along the negative y-axis, clockwise would proceed from point2 to point1. To see the difficulty more clearly, imagine you have three non-colinear points in some other, arbitrary orientation. Depending on which side of the plane they lie in that one looks at them from, the sense of clockwise versus counterclockwise reverses. The notion of clockwise rotation is strictly a two-dimensional concept. It has the same indeterminacy as trying to distinguish between the two sides of an arbitrary three-dimensional plane. Which side is the "plus" side and which is the "minus" side?

Subject: Clockwise or in Clockwise angles

From: Steven Lord

Date: 22 Jan, 2014 20:10:10

Message: 3 of 7


"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in
message news:lbp80d$cpu$1@newscl01ah.mathworks.com...
> "Mahsa" wrote in message <lbov53$nnk$1@newscl01ah.mathworks.com>...
>> Hello,
>> I have three point in 3D for example=
>> point1=[-1;0;0]
>> middlePoint=[0;0;0]
>> point2=[0;0;-1]
>>
>> I need a way to give me +90 degree if I give the points in this order
>> (point1,middlePoint,point2)
>> and -90 in this order:
>> (point2;middlePoint,point2)
>>
>> So I need to make distinguish between clockwise or in clockwise rotation.
>> Thank you
> - - - - - - - - -
> In three dimensions the notion of clockwise versus counterclockwise loses
> its meaning. In your example if one looks at the three points from some
> point along the positive y-axis, clockwise would go from point1 to point2,
> but if you looked at them from somewhere along the negative y-axis,
> clockwise would proceed from point2 to point1. To see the difficulty more
> clearly, imagine you have three non-colinear points in some other,
> arbitrary orientation. Depending on which side of the plane they lie in
> that one looks at them from, the sense of clockwise versus
> counterclockwise reverses. The notion of clockwise rotation is strictly a
> two-dimensional concept. It has the same indeterminacy as trying to
> distinguish between the two sides of an arbitrary three-dimensional plane.
> Which side is the "plus" side and which is the "minus" side?

An easier and less imaginative way to see this more clearly (pun
semi-intended): use a (NON-permanent; dry- or wet-erase will probably be
okay) marker to draw two vectors and an arrow connecting the two on a
window. Look at the diagram from one side of the window and decide which way
the arrow is pointing, then go to the other side and repeat.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: Clockwise or in Clockwise angles

From: Mahsa

Date: 22 Jan, 2014 21:03:08

Message: 4 of 7

"Mahsa" wrote in message <lbov53$nnk$1@newscl01ah.mathworks.com>...
> Hello,
> I have three point in 3D for example=
> point1=[-1;0;0]
> middlePoint=[0;0;0]
> point2=[0;0;-1]
>
> I need a way to give me +90 degree if I give the points in this order
> (point1,middlePoint,point2)
> and -90 in this order:
> (point2;middlePoint,point2)
>
> So I need to make distinguish between clockwise or in clockwise rotation.
> Thank you

Thank you all for your advice,
I found the poly2ccw function useful to determine clockwise or counter clockwise direction.

Subject: Clockwise or in Clockwise angles

From: John D'Errico

Date: 22 Jan, 2014 22:43:05

Message: 5 of 7

"Mahsa" wrote in message <lbpbmb$iqt$1@newscl01ah.mathworks.com>...
> "Mahsa" wrote in message <lbov53$nnk$1@newscl01ah.mathworks.com>...
> > Hello,
> > I have three point in 3D for example=
> > point1=[-1;0;0]
> > middlePoint=[0;0;0]
> > point2=[0;0;-1]
> >
> > I need a way to give me +90 degree if I give the points in this order
> > (point1,middlePoint,point2)
> > and -90 in this order:
> > (point2;middlePoint,point2)
> >
> > So I need to make distinguish between clockwise or in clockwise rotation.
> > Thank you
>
> Thank you all for your advice,
> I found the poly2ccw function useful to determine clockwise or counter clockwise direction.

As the others have said, given ONLY three points, you cannot determine
the desired direction.

However, you have more information than you let on, i.e., the ORDER
of the points in a polygon.

Be clear in your questions in the future, and you will get better answers.

John

Subject: Clockwise or in Clockwise angles

From: Roger Stafford

Date: 23 Jan, 2014 02:19:09

Message: 6 of 7

"Mahsa" wrote in message <lbpbmb$iqt$1@newscl01ah.mathworks.com>...
> Thank you all for your advice,
> I found the poly2ccw function useful to determine clockwise or counter clockwise direction.
- - - - - - - - - -
The 'poly2ccw' function only works in two dimensions where clockwise and counterclockwise have a meaning. With the three dimensional case which you asked about there is no way this function could be generalized in a reasonable way to perform the clockwise/counterclockwise determination you have asked for.

Roger Stafford

Subject: Clockwise or in Clockwise angles

From: Mahsa

Date: 26 Mar, 2014 15:54:06

Message: 7 of 7

"Roger Stafford" wrote in message <lbpu6s$2g7$1@newscl01ah.mathworks.com>...
> "Mahsa" wrote in message <lbpbmb$iqt$1@newscl01ah.mathworks.com>...
> > Thank you all for your advice,
> > I found the poly2ccw function useful to determine clockwise or counter clockwise direction.
> - - - - - - - - - -
> The 'poly2ccw' function only works in two dimensions where clockwise and counterclockwise have a meaning. With the three dimensional case which you asked about there is no way this function could be generalized in a reasonable way to perform the clockwise/counterclockwise determination you have asked for.
>
> Roger Stafford

Yes, you are right 'poly2ccw' is not working in 3D, so is any other way to distinguish the clockwise or counter-clockwise order in a sequence of 3points in 3D?

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us