The total length of the cables is equal to the sum of the hypotenuses of each right angle.
For the first triangle (on the left, the smaller one) we have to apply the trigonometric function:
Sin β = opposite side / hypotenuse
Where:
β= angle
opposite side = 12
Replacing:
Sin 45 = 12/ h1
Solve for h1
h1= 12/sin45
h1= 16.97m
Same process for the big triangle:
Sin 30 = 12/h2
h2 = 12/Sin30 = 24 m
Add both lenghts:
h1+h2= 16.97+24 = 40.97 m