Sign in to follow this  
BrknPhoenix

Finding the Z axis of a circle

Recommended Posts

BrknPhoenix    122
I already know getting the x and y of a circle's path is like this:
        circ_x = CIRCLE_SIZE * cos(circ_angle * (PI / 180.0f));
        circ_y = CIRCLE_SIZE * sin(circ_angle * (PI / 180.0f));
But how would I arrive at a z coordinate?

Share this post


Link to post
Share on other sites
jyk    2094
Quote:
Original post by BrknPhoenix
I already know getting the x and y of a circle's path is like this:


circ_x = CIRCLE_SIZE * cos(circ_angle * (PI / 180.0f));
circ_y = CIRCLE_SIZE * sin(circ_angle * (PI / 180.0f));


But how would I arrive at a z coordinate?
If the circle lies in the xy plane, then the z value is zero. If the circle lies in an arbitrary plane, you need to define a basis for the circle. You can then compute points on the circle as follows:
p = C + cos(angle) * U * CIRCLE_SIZE + sin(angle) * V * CIRCLE_SIZE
Where C is the circle center, and U and V are orthonormal basis vectors lying in the specified plane.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this