简体   繁体   中英

Centre line of a circle in 3d space

I currently have a circle with a centre and various edge points.

In 3D space I need to find the line the goes through the centre of the circle (so is also perpendicular to the plane formed by the circle and would intersect the centre point).

I guess rather than an actual formula for the line I just need another point on that line, including the centre.

I'm implementing this in C# and have access to vector classes and the like.

Anyone have any idea how I'd approach this?

Thanks.

You can take two radial vectors, ie vectors which point from the center to a point on the circle. You'd likely obtain them by computing a vector difference. Then compute the cross product between these two; it will be a vector which is perpendicular to both the radial vectors. Add that result to the center and you have another point along the line. When choosing which two points along the rim to use, try to make the (squared) length of the resulting cross product as large as possible, since that will give the most numerically stable results.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM