Raycasting Distance Calculation

Top-Down View
Wall Rendering (What Player Sees)

Player Controls

Wall Hit Point:
X: 300, Y: 100

Euclidean Distance:
141.42

Fixed Distance (Corrected):
100.00

Wall Height Ratio:
Euclidean: 1.00
Fixed: 1.41

Why Use use_distance(delta_x, delta_y)?

The use_distance function calculates the Euclidean distance between two points using the Pythagorean theorem: √(x² + y²)

Why we need use_fixed_dist:

The formula breakdown: