Here you can find the source of distHalf(double angA, double angB)
Parameter | Description |
---|---|
angA | Angle between -pi/2 and pi/2. |
angB | Angle between -pi/2 and pi/2. |
public static double distHalf(double angA, double angB)
//package com.java2s; /*//from www. java 2 s .co m * Copyright (c) 2011-2012, Peter Abeles. All Rights Reserved. * * This file is part of Geometric Regression Library (GeoRegression). * * GeoRegression is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 3 * of the License, or (at your option) any later version. * * JGRL 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with GeoRegression. If not, see <http://www.gnu.org/licenses/>. */ public class Main { /** * Angular distance between two half circle angles. * * @param angA Angle between -pi/2 and pi/2. * @param angB Angle between -pi/2 and pi/2. * @return Acute angle between the two input angles. */ public static double distHalf(double angA, double angB) { double a = Math.abs(angA - angB); if (a <= Math.PI / 2) return a; else return Math.PI - a; } }