2
votes

I wish to determine if a Point P(x,y,z) is inside a 2D circle in 3D space defined by its center C (cx, cy, cz), radius R, and normal to the plane the circle lies on N.

I know that a point P lying on a 2D circle in 3D space is defined by:

P = R*cos(t)U + Rsin(t)*( N x U ) + C

where U is a unit vector from the center of the circle to any point on the circle. But given a point Q, how do I know if Q is on or inside the circle? What is the appropriate parameter t to choose? And which coordinates do I compare the point Q to see if they are within the circle?

Thanks.

2
Care to clarify your notation? What's this noise about? Looks like it could be the magnitude of a vector, but it encourages others to provide useful answers when your question is clearly presented.3Dave
I tried to bold them but they wouldn't bold....? the U is a bold vector, indicating a vector. Same for N. EDIT: I bolded the letters by taking them out of the "code" sectionMyx
Did you try looking up info on 3d mouse picking?HyperCas
@HyperCas: I did. I'm not sure it's applicable. The problem seems to be much simpler...?Myx

2 Answers

10
votes

Project P onto the plane containing the circle, call that P'. P will be in the circle if and only if |P - P'| = 0 and |P' - C| < R.

3
votes

I'd do this by breaking it into two parts:

  1. Find out if the point is on the same plane as the circle (ie. see if the dot product of the vector going from the center to the point and the normal is zero)

  2. Find out if it's inside the sphere containing the circle (ie. see if the distance from the center to the point is smaller than the radius).