Java Graphics Rotate rotatePoint(Point center, Point p, double angle)

Here you can find the source of rotatePoint(Point center, Point p, double angle)

Description

rotate Point

License

Open Source License

Declaration

private static Point rotatePoint(Point center, Point p, double angle) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.awt.*;
import java.awt.geom.AffineTransform;

public class Main {
    private static Point rotatePoint(Point center, Point p, double angle) {
        double[] pt = { p.x, p.y };
        AffineTransform.getRotateInstance(Math.toRadians(360 - angle), center.x, center.y).transform(pt, 0, pt, 0,
                1);//w  w w .ja v  a2  s.com
        return new Point((int) Math.round(pt[0]), (int) Math.round(pt[1]));
    }
}

Related

  1. rotateHue(Color color, float fraction)
  2. rotateMoveClockwise(Point move, int size)
  3. rotatePoint(double x0, double y0, double x, double y, double a)
  4. rotatePoint(double x0, double y0, double x, double y, double angle)
  5. rotatePoint(int x, int y, int xC, int yC, float angle)
  6. rotatePoint(Point point, Point centerPoint, double angle)
  7. rotatePoint(Point reference, Point toRotate, int degrees)
  8. rotatePoint(Point target, Point origin, double theta)
  9. rotatePoint2D(final Point aPoint, final float aDeg)