(int x, int y, Calibration cal)
| 2915 | } |
| 2916 | |
| 2917 | String getFFTLocation(int x, int y, Calibration cal) { |
| 2918 | double center = width/2.0; |
| 2919 | double r = Math.sqrt((x-center)*(x-center) + (y-center)*(y-center)); |
| 2920 | double theta = Math.atan2(y-center, x-center); |
| 2921 | theta = theta*180.0/Math.PI; |
| 2922 | if (theta<0) theta=360.0+theta; |
| 2923 | String s = "r="; |
| 2924 | if (r<1.0) |
| 2925 | return s+"Infinity/c (0)"; //origin ('DC offset'), no angle |
| 2926 | else if (cal.scaled()) |
| 2927 | s += IJ.d2s((width/r)*cal.pixelWidth,2) + " " + cal.getUnit() + "/c (" + IJ.d2s(r,0) + ")"; |
| 2928 | else |
| 2929 | s += IJ.d2s(width/r,2) + " p/c (" + IJ.d2s(r,0) + ")"; |
| 2930 | s += ", theta= " + IJ.d2s(theta,2) + IJ.degreeSymbol; |
| 2931 | return s; |
| 2932 | } |
| 2933 | |
| 2934 | /** Converts the current cursor location to a string. */ |
| 2935 | public String getLocationAsString(int x, int y) { |
no test coverage detected