how to draw a 3d circle around a known point on a line segment .

Started by
5 comments, last by ohsin 14 years, 2 months ago
http://i.imgur.com/SkKwT.png The image above illustrates my problem.I have a line AB and a point C on it, A,B,C are known values, i need to draw a circle with center on point C.The circle containing plane is perpendicular to the given line. i know the equation of circle in 3d would be P = C + R cos(A) U + R sin(A) V but i don't know how to get U and V here as no point on the outline of circle is known.. thank you. [Edited by - ohsin on February 11, 2010 7:38:13 AM]
Advertisement
If you know the distance of the plane to the origin you can calculate 2 points on the plane and generate a normal vector on the plane, multiplying this normal with your circle radius and adding it to center of your circle should give you a point on the circle.
Thank you for replying i will try this as soon as i can .
This thread might prove useful. You need to find a length-one vector perpendicular to (B-A). Call it U. Then you can easily find V as the normalized cross product of U and (B-A).
i googled a bit more and found this link
http://newsgroups.derkeiler.com/Archive/Comp/comp.graphics.algorithms/2005-10/msg00267.html

Now i am drawing an ellipse instead of a circle using code from the link
..close yet far...
Assuming you have the distance to the plane all you need is the plane equation: Ax + By + Cz + D = 0 with A, B and C being your plane's normal, D being the distance to the plane and x,y and z being any point on the plane. Once you have a point on the plane use the center of your circle and subtract the newly found point from that and normalize it, this gives you your U or V. Then use a cross product on either U or V with the normal of the plane and the result will be your U or V.
SUCCESS!!!!!! :D

YAY! Mussi i did exactly what you told me and first i drew ellipses then i normalised V as well and VOILA circles!! i love circles!!

Thank you all for helping. :-)

This topic is closed to new replies.

Advertisement