Marshall Lochbaum wrote:
> 
> Alright. Take the projection of the center onto the line segment using %.
> .
> This is not allowed to be more than 0 or less than 1, so use (0>.1<.]) to
> take the endpoints if it is. Then find this point on the line again and
> see
> if it is inside the circle.
> C (R>:+/&.:*:)@:([- ]* 0>.1<.%.)&(-&S) E
> 
> Not tested yet, but I will update on that...
> Marshall
> 
> 
> 
That's a nice one!

To avoid %: :

R (>:+/)&*: C ([- ]* 0>.1<.%.)&(-&S) E


-- 
View this message in context: 
http://old.nabble.com/Puzzle%3A-line-circle-sphere-intersection-tp29900737s24193p29916445.html
Sent from the J Programming mailing list archive at Nabble.com.

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to