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

Method rotate

ij/src/main/java/ij/plugin/RoiRotator.java:75–86  ·  view source on GitHub ↗
(Roi roi, double angle)

Source from the content-addressed store, hash-verified

73 }
74
75 public static Roi rotate(Roi roi, double angle) {
76 if (roi instanceof ImageRoi) {
77 ((ImageRoi)roi).rotate(angle);
78 return roi;
79 }
80 FloatPolygon center = roi.getRotationCenter();
81 double xcenter = center.xpoints[0];
82 double ycenter = center.ypoints[0];
83 Roi roi2 = rotate(roi, angle, xcenter, ycenter);
84 roi2.setRotationCenter(xcenter,ycenter);
85 return roi2;
86 }
87
88 public static Roi rotate(Roi roi, double angle, double xcenter, double ycenter) {
89 double theta = -angle*Math.PI/180.0;

Callers 5

runMethod · 0.95
rotateMethod · 0.95
rotateRoiMethod · 0.95
rotateMethod · 0.95
rotateShapeMethod · 0.45

Calls 9

setRotationCenterMethod · 0.95
rotateShapeMethod · 0.95
addPointMethod · 0.95
copyAttributesMethod · 0.95
getTypeMethod · 0.65
getRotationCenterMethod · 0.45
getFloatPolygonMethod · 0.45
getParamsMethod · 0.45
sqrtMethod · 0.45

Tested by

no test coverage detected