I am following this tutorial https://lodev.org/cgtutor/raycasting.html
When deriving deltaDistX geometrically you get, with Pythagoras, the formula "sqrt(1 + (rayDirY * rayDirY) / (rayDirX * rayDirX))", but this can be simplified to abs(1 / rayDirX). [thanks to Artem for spotting this simplification] Similarly, deltaDistY is "sqrt(1 + (rayDirX * rayDirX) / (rayDirY * rayDirY))" which can be simplified to abs(1 / rayDirY). The variable perpWallDist will be used later to calculate the length of the ray.
In the calculation that involves Pythagoras, why is a "+1" involved? I thought the equation was a^2+b^2=c^2? I feel dense... Also, I do not understand how the simplification to abs(1/rayDirX) works.