Java Angle from Point getAngle(Point2D center, Point2D point)

Here you can find the source of getAngle(Point2D center, Point2D point)

Description

get Angle

License

Open Source License

Declaration

public static double getAngle(Point2D center, Point2D point) 

Method Source Code


//package com.java2s;
import java.awt.geom.Point2D;

public class Main {
    public static double getAngle(Point2D center, Point2D point) {
        return Math.atan2(-(point.getY() - center.getY()), point.getX() - center.getX());
    }/* ww w  . j  a v a2 s .  c o m*/
}

Related

  1. getAngle(double originX, double originY, double x, double y)
  2. getAngle(Point2D origin, Point2D target)
  3. getAngle(Point2D p1, Point2D p2)
  4. getAngle(Point2D startPosition, Point2D endPosition)
  5. getAngle(Point2D.Double vertPt, Point2D.Double edgePt)