Coefficient of determination, # R^2 # is the square of correlation coefficient, #r#. Naturally, the correlation coefficient can be calculated as the square root of coefficient of determination. But there's a catch, when we take square root of a positive number, the answer can be either positive or negative. To solve this, we take the sign that is consistent with the data, i.e, if data is shows an upward trend then we take positive sign, otherwise we take negative sign.

# \text{correlation coefficient} = (\text{sign of slope}) \sqrt{\text{Coefficient of determination}} #

Note that slope of regression line is consistent with this sign, so we can take the sign of slope too.