Alright. First we draw a diagram. I have labelled the points of the triangle
We know that in the first diagram,
We know that in the second diagram,
Using the trig ratio
I can say in both diagrams,
In the first diagram,
In the second diagram,
Now, we can see that the change in height is just:
As to where the values came from, there's a table for it.
If you are up to a challenge, you can try deriving where the exact values of the trig functions came from.
When the ladder makes an angle of 45 degrees we have:
Hence, distance of slip is: