I will test your r2p_corproc, when the Xin and Yin are both zero, i have a result no zero in angle but the radius have zero. what is the probleme ?
Xin 0.000000e+000 Yin 0.000000e+000 Radius 0.000000e+000 Angle 9.900000e+001
This is not a mistake; the result is correct. Or at least what would be expected. The radius is 0 ... whatever the associated angle might be is irrelevant.
Think about the radius as a line (that's what it really is). A line of zero length is basically a point. It is mathematically incorrect to associate an angle with a point. Therefore the result is correct.
Richard