rotateAroundPoint static method

Geometry rotateAroundPoint(
  1. Geometry g,
  2. Geometry? pt,
  3. double angle
)

Rotate a geometry around a point by an angle in radians

Implementation

static Geometry rotateAroundPoint(
    Geometry g,
    Geometry? pt,

    /// Angle (radians)
    double angle) {
  Coordinate loc;
  if (pt == null) {
    loc = new Coordinate(0, 0);
  } else {
    loc = pt.getCoordinates()[0];
  }
  AffineTransformation trans =
      AffineTransformation.rotationInstanceTXY(angle, loc.x, loc.y);
  return trans.transformGeom(g);
}