Here you can find the source of rotateByAngle(final Point2D pos, final Point2D center, final double angle)
Parameter | Description |
---|---|
pos | The point to rotate. |
center | The center. |
angle | The angle. |
public static Point2D rotateByAngle(final Point2D pos, final Point2D center, final double angle)
//package com.java2s; //License from project: Open Source License import java.awt.geom.AffineTransform; import java.awt.geom.Point2D; public class Main { /**//from w w w . j a va2 s . c om * Rotates a point a given angle around the center. * * @param pos The point to rotate. * @param center The center. * @param angle The angle. * @return The rotated point. */ public static Point2D rotateByAngle(final Point2D pos, final Point2D center, final double angle) { final AffineTransform at = AffineTransform.getRotateInstance(angle, center.getX(), center.getY()); return at.transform(pos, null); } }