# Determining 3D points on a 3d circle with center and normal vector

This topic is 4675 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hey guys. Here's a funcky question I haven't found a good answer for yet. I have a point in 3d space and a direction vector (basically, a ray). I want to determine a 3d point on the outer edge of the circle for some radius and some theta. I know it's possible, but the math isn't clear to me. Anyone have any clues as to how I can do it?

##### Share on other sites
If you mean circle:

You can always find the edge on the xy-parrelel-plane by adding (sinv, cosv) to the coordinate. You'll have to turn the apropriately if you want it to be on some other plane.

If you mean sphere:

No idea, but you'd need two angles two describe an exact point.

##### Share on other sites
right i know how to find values in 2d... i guess i'm trying to figure out how to rotate that circle's plane, like you said, such that the points on the actual circle rotate properly around the circle's center point.

i need to calculate this... cant use transforms. surely someone's done it.

##### Share on other sites
Quote:
 Original post by datadawgxi need to calculate this... cant use transforms. surely someone's done it.
The question probably has an easy answer, but perhaps you could clarify what you're after. It sounds like you have a point and a vector, and you want to create points on a circle centered on that point, and lying in a plane whose normal is perpendicular to the vector. Is that right?

##### Share on other sites
Quote:
 Original post by datadawgxright i know how to find values in 2d... i guess i'm trying to figure out how to rotate that circle's plane, like you said, such that the points on the actual circle rotate properly around the circle's center point.

Find the normal vector of the plane and rotate it?

##### Share on other sites
jyk is on the money. that's exactly what i'm trying to do. any tips?

##### Share on other sites
Quote:
It kind of depends on what you're really doing (creating a mesh around a curve of some sort, for example), and what the constraints are. One solution though is to build an arbitrary local coordinate system around the point and the vector, and then use it to construct the vertices of the circle. Ask if you need help with the details (actually, this could probably stand to be in an FAQ somewhere, as it comes up quite often).

##### Share on other sites
i'm not trying to create geometry, per se, but i am looking for vertex-like information (3d points on the circle's arc). i think i understand what you are saying about the local coordinate system... essentially, i'd be picking points from a circle that lies on a plane in 3d space, and then i want to rotate the circle's plane (and the defined points) such that the circle's normal points in the desired direction.

i can't wrap myself around the math. are matrix transforms in inevidable?

##### Share on other sites
This is all you need.

It's about moving cameras around without gimbal lock, but think about it: you want to rotate a vector around another one. Quaternions are (I haven't gotten into them much) fast and easy to use.

Have fun!

##### Share on other sites
Say you have point 'P' which is the centre of your circle and normal 'N'. You can create a random point 'A' that lies on the circle of given radius as follows:

- create a random vector 'V' (e.g. 0.34234, 0.565754, -0.5443) those numbers can be picked randomly. Just make sure the numbers you pick do not result in a null vector or one that is parallel with your vector N, or you will have trouble in the normalisation stage.

- create vector 'R' where: R = crossproduct(N, V)

- normalise(R)

// R is a random vector of unit length lying in the plane defined by normal N

- A = P + R * radius

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 10
• 11
• 13
• 9
• 11
• ### Forum Statistics

• Total Topics
634092
• Total Posts
3015447
×