Java Geometry Algorithm absoluteBearing(Point2D source, Point2D target)

Here you can find the source of absoluteBearing(Point2D source, Point2D target)

Description

absolute Bearing

License

Open Source License

Declaration

public static double absoluteBearing(Point2D source, Point2D target) 

Method Source Code


//package com.java2s;
// This code is released under the RoboWiki Public Code Licence (RWPCL), datailed on:

import java.awt.geom.*;

public class Main {
    public static double absoluteBearing(Point2D source, Point2D target) {
        if (source == null || target == null) {
            return 0;
        }//from   w  w  w  .j a  v a2s  . c  om
        return Math.atan2(target.getX() - source.getX(), target.getY() - source.getY());
    }
}

Related

  1. absoluteBearing(Point2D.Double sourceLocation, Point2D.Double target)
  2. applyCoG(Point2D.Double[] points, Point2D.Double cog)
  3. applyDynamism(final Point[] spline, final int msForMove, final int msPerMove)
  4. applyMidPointApprox(CubicCurve2D cubic, QuadCurve2D quad)