GregLocock
Automotive
- Apr 10, 2001
- 23,767
Hi I need an efficient Matlab algorithm for the intersection of a line in 3d space (or its extension) defined by 2 points A and B , and a sphere of radius r and known centre location C.
In this case the line always intersects the sphere, at two points D and E, ie I don't need error checking for the tangential or missing case, and I am only interested in the solution for whichever of D or E is nearest A.
This calculation needs repeating millions of times, hence a fast solution would be preferred.
Any hints?
Cheers
Greg Locock
SIG
lease see FAQ731-376 for tips on how to make the best use of Eng-Tips.
In this case the line always intersects the sphere, at two points D and E, ie I don't need error checking for the tangential or missing case, and I am only interested in the solution for whichever of D or E is nearest A.
This calculation needs repeating millions of times, hence a fast solution would be preferred.
Any hints?
Cheers
Greg Locock
SIG