Jump to content

Find the intersection of a line with a plane: Difference between revisions

m
Line 10:
 
<lang 11l>F intersection_point(ray_direction, ray_point, plane_normal, plane_point)
returnR ray_point - ray_direction * dot(ray_point - plane_point, plane_normal) / dot(ray_direction, plane_normal)
 
print(‘The ray intersects the plane at ’intersection_point((0.0, -1.0, -1.0), (0.0, 0.0, 10.0), (0.0, 0.0, 1.0), (0.0, 0.0, 5.0)))</lang>
1,481

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.