Aim: Compute correlation coefficient and main axes from a list of (X,Y) coordinates assuming identical and independent errors on X and Y.
The routine declaration is:
real function corrCoeff(x, y, theta, sigma1, sigma2)
! x, y : list of X and Y values
! Returns if present:
! theta : rotation angle (radians, between -pi/4 and pi/4) to main axes
! sigma1 : dispersion along theta (not necessarily major axis)
! sigma2 : dispersion perpendicular to theta
real, intent(in) , dimension(:) :: x, y
real, intent(out), optional :: theta, sigma1, sigma2