Java Angle angleDistance(double angle1, double angle2)

Here you can find the source of angleDistance(double angle1, double angle2)

Description

angle Distance

License

Open Source License

Declaration

public static double angleDistance(double angle1, double angle2) 

Method Source Code

//package com.java2s;
/*//  w ww  .ja v  a 2 s .c o m
 * Created on 10-feb-2005
 *
 * gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
 *
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * For more information, contact:
 *
 *  Generalitat Valenciana
 *   Conselleria d'Infraestructures i Transport
 *   Av. Blasco Ib??ez, 50
 *   46010 VALENCIA
 *   SPAIN
 *
 *      +34 963862235
 *   gvsig@gva.es
 *      www.gvsig.gva.es
 *
 *    or
 *
 *   IVER T.I. S.A
 *   Salamanca 50
 *   46005 Valencia
 *   Spain
 *
 *   +34 963163400
 *   dac@iver.es
 */

public class Main {

    public static double angleDistance(double angle1, double angle2) {
        if (angle1 < angle2) {
            return angle2 - angle1;
        } else {
            return ((Math.PI * 2) - angle1) + angle2;
        }
    }
}

Related

  1. angle(float x1, float y1, float x2, float y2)
  2. angle2degree(double angle)
  3. angle2pixels(double angle)
  4. angle360Limit(float angle)
  5. angleAdd(int i, final int i1)
  6. angleEquals(double angle1, double angle2, double epsilon)
  7. AngleEvaluation(double angle, int effectIndex, int angleNeeded, int orbValue)
  8. angleFromDirection(float dirX, float dirY)
  9. angleFromR(final double[][] R)