Trying to understand mathematically

For #2, yes, you’re feeding origin: and direction: into Raycast, telling it where to start and where to go.

Sin/Cos/Tan still work as expected. It’s just not necessary here because you’re not going from an angle (polar coordinates) to cartesian corodinates (x,y). You just HAVE a position and a direction and that’s all Raycast needs.

Side note: The various Raycast functions are HORRIBLY overloaded, so it’s always best to supply the names of the arguments for all arguments, just to keep you from inadvertently crossing wires, like crossing up origin and direction for instance. Look up named arguments for how to do that. The little bit of extra typing for horribly overloaded calls like that is well worth it, IMNSHO.

ALSO, there are three broad types of raycasting in Unity:

Raycasting, colliders, planes, Plane, etc: