Returns the angle in degrees between the specified line and a horizontal line.
(double x1, double y1, double x2, double y2)
| 1955 | |
| 1956 | /** Returns the angle in degrees between the specified line and a horizontal line. */ |
| 1957 | public double getFloatAngle(double x1, double y1, double x2, double y2) { |
| 1958 | double dx = x2-x1; |
| 1959 | double dy = y1-y2; |
| 1960 | if (imp!=null && !IJ.altKeyDown()) { |
| 1961 | Calibration cal = imp.getCalibration(); |
| 1962 | dx *= cal.pixelWidth; |
| 1963 | dy *= cal.pixelHeight; |
| 1964 | } |
| 1965 | return (180.0/Math.PI)*Math.atan2(dy, dx); |
| 1966 | } |
| 1967 | |
| 1968 | /** Sets the default (global) color used for ROI outlines. |
| 1969 | * @see #getColor() |
no test coverage detected