MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / getFloatAngle

Method getFloatAngle

ij/src/main/java/ij/gui/Roi.java:1957–1966  ·  view source on GitHub ↗

Returns the angle in degrees between the specified line and a horizontal line.

(double x1, double y1, double x2, double y2)

Source from the content-addressed store, hash-verified

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()

Callers 8

getAngleMethod · 0.95
measureLengthMethod · 0.80
saveResultsMethod · 0.80
showStatusMethod · 0.80
showStatusMethod · 0.80
mouseMovedMethod · 0.80
getAngleAsStringMethod · 0.80
getAngleMethod · 0.80

Calls 2

altKeyDownMethod · 0.95
getCalibrationMethod · 0.80

Tested by

no test coverage detected