Here you can find the source of minusPIO2(final double angRad)
Parameter | Description |
---|---|
angRad | An angle, in radians. |
public static double minusPIO2(final double angRad)
//package com.java2s; //License from project: Open Source License public class Main { private static final double PIO2_HI = Double.longBitsToDouble(0x3FF921FB54400000L); private static final double PIO2_LO = Double.longBitsToDouble(0x3DD0B4611A626331L); /**/* w w w . jav a 2 s . co m*/ * @param angRad * An angle, in radians. * @return angRad - PI/2, accurately computed. */ public static double minusPIO2(final double angRad) { if (angRad < Math.PI / 4) { // LO then HI, for better accuracy (if starting near 0). return angRad - PIO2_LO - PIO2_HI; } else { // HI then LO, for better accuracy (if ending near 0). return angRad - PIO2_HI - PIO2_LO; } } }