We know that because of line CD, these 2 trangles are similar. That means we can redraw triangle ADC to look like triangle CDB. In doing so, we can finally set up these proprtions to the leg lengths.

Another way to think of this is to just seperate the two triangles as they are, and rotate triangle ADC 90° clockwise in order to set up the proportions.

I hope this helped, it was hard to explain without visuals