ScratchData LogoScratchData
Back to sureornot's profile

Ray Cylinder Intersection

SUsureornot•Created May 21, 2021
Ray Cylinder Intersection
6
2
90 views
View on Scratch

Instructions

A test for the ray-cylinder intersection: Sliders to change the setting. Space to reset E key to end. Recommended to use TurboWarp: https://turbowarp.org/

Description

The infinite unit cylinder aligned along: X-axis : y^2 + z^2 = 1 Y axis : x^2 + z^2 = 1 Z axis : x^2 + y^2 = 1 Ray P = P0 + t*P1 Cylinder x^2 + z^2 = r^2 (P0x + t * P1x)^2 + (P0z + t * P1z)^2 = r^2 ==> [(P1x)^2 + (P1z)^2] * t^2 + [2 * (P0x * P1x) + 2 * (P0z * P1z)] + [(P0x)^2 + (P0z)^2 - r^2] = 0 The finite open ended cylinder x^2 + z^2 = r^2 ymin < y < ymax

Project Details

Project ID533801701
CreatedMay 21, 2021
Last ModifiedMay 30, 2021
SharedMay 30, 2021
Visibilityvisible
CommentsAllowed