Sens4
Sens4

Reputation: 665

determine if a point is left or right from another point on a circle in 3d space?

I want to determine if a point from another point on a circle in the left section or in the right section. (left & right just a matter of sign interpretaton). For that I have calculated the cross product of those two points for creating the normal vector. So the problem which I am facing is how I can interpret the normal as an scalar which has a sign which indicates whether its in the right or in the left half of the circle.

I have created a gif as for illustration (C' is just the animated point C):

enter image description here

My idea was to add all values within the vector v. For instance:

v = (0.16, 0.1, -0.2)
vSum = v.x + v.y + v.z = 0.06

result = sign(vSum) = 1

o = (-0.16, -0.1, 0.2)
oSum = o.x + o.y + o.z = -0.06

result = sign(oSum) = -1

unfortunately this does only work if the circle is static and does not rotate. If its rotating the sign changes so my result is flipped which leads to reversed left and right sites. And the dot product results positive values only, but this is a value which doesnt changes while rotating the circle. Maybe this is something which can help me ?

Upvotes: 0

Views: 533

Answers (1)

Nico Schertler
Nico Schertler

Reputation: 32587

I assume, your cross product is the following:

c = cross(p - circle center, reference - circle center)

Then you can take the dot product with the circle normal to get the sign:

sign(dot(c, circle normal))

Upvotes: 1

Related Questions