It's the same formula as the one used on Earth. It is based on the Pythagorean theorem.
length = √((∆x)^2 +(∆y)^2 +(∆z)^2)
.. where ∆x, ∆y, ∆z are the differences between the end-point coordinates in the x-, y-, and z-directions, respectively.
25% of 150000 is 0.25 * 150000 = 37500
So, they now cost 150000 + 37500 = 187500 and that is the answer you are looking for