# Introduction to raycasting

> Learn about rays that point from the camera to a position in world space.

In the section [Understanding the View Frustum](/engine/6000.7/manual/cameras/camera-view/understanding-frustum.md), it was explained that any point in the camera's view corresponds to a line in world space. It is sometimes useful to have a mathematical representation of that line and Unity can provide this in the form of a [Ray](/engine/6000.7/script-reference/unityengine/ray.md) object. The Ray always corresponds to a point in the view, so the Camera class provides the [ScreenPointToRay](/engine/6000.7/script-reference/unityengine/camera/screenpointtoray.md) and [ViewportPointToRay](/engine/6000.7/script-reference/unityengine/camera/viewportpointtoray.md) functions. The difference between the two is that ScreenPointToRay expects the point to be provided as a pixel coordinate, while ViewportPointToRay takes normalized coordinates in the range 0..1 (where 0 represents the bottom or left and 1 represents the top or right of the view). Each of these functions returns a Ray which consists of a point of origin and a vector which shows the direction of the line from that origin. The Ray originates from the near clipping plane rather than the Camera's transform.position point.
