It says Sphere in the title but I actually meant Cylinder (Ive been working on it a few hours and brains gone numb). The problem is to do with an algorithm for a game im making in openGL. I need the points of intersect of a vector (O+Dt) and a cylinder with radius r, direction A and point on the cylinder core B (we can assume infinite height).(adsbygoogle = window.adsbygoogle || []).push({});

So far I had the following

[itex]| (O + D . t1) - (A + B . t2 ) | = r[/itex]

and

[itex]B . ( (O + D . t1) - (A + B . t2 ) ) = 0[/itex]

and then tried to solve it, but the equation became quite long and I likely made an error along the way.

Does anyone have an easier way of solving it, or has anyone solved it before?

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Arbitrary vector intersect sphere

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

**Physics Forums | Science Articles, Homework Help, Discussion**