public static void sinAndCos(double angle,DoubleWrapper sine,DoubleWrapper cosine){
  if (USE_JDK_MATH) {
    sine.value=STRICT_MATH ? StrictMath.sin(angle) : Math.sin(angle);
    cosine.value=STRICT_MATH ? StrictMath.cos(angle) : Math.cos(angle);
    return;
  }
  boolean negateResult;
  if (angle < 0.0) {
    angle=-angle;
    negateResult=true;
  }
 else {
    negateResult=false;
  }
  if (angle > SIN_COS_MAX_VALUE_FOR_INT_MODULO) {
    angle=remainderTwoPi(angle);
    if (angle < 0.0) {
      angle+=2 * Math.PI;
    }
  }
  int index=(int)(angle * SIN_COS_INDEXER + 0.5);
  double delta=(angle - index * SIN_COS_DELTA_HI) - index * SIN_COS_DELTA_LO;
  index&=(SIN_COS_TABS_SIZE - 2);
  double indexSin=sinTab[index];
  double indexCos=cosTab[index];
  double result=indexSin + delta * (indexCos + delta * (-indexSin * ONE_DIV_F2 + delta * (-indexCos * ONE_DIV_F3 + delta * indexSin * ONE_DIV_F4)));
  sine.value=negateResult ? -result : result;
  cosine.value=indexCos + delta * (-indexSin + delta * (-indexCos * ONE_DIV_F2 + delta * (indexSin * ONE_DIV_F3 + delta * indexCos * ONE_DIV_F4)));
}

public static void sinAndCos ( double angle , DoubleWrapper sine , DoubleWrapper cosine ) { if ( USE_JDK_MATH ) { sine . value = STRICT_MATH ? StrictMath . sin ( angle ) : Math . sin ( angle ) ; cosine . value = STRICT_MATH ? StrictMath . cos ( angle ) : Math . cos ( angle ) ; return ; } boolean negateResult ; if ( angle < 0.0 ) { angle = - angle ; negateResult = true ; } else { negateResult = false ; } if ( angle > SIN_COS_MAX_VALUE_FOR_INT_MODULO ) { angle = remainderTwoPi ( angle ) ; if ( angle < 0.0 ) { angle += 2 * Math . PI ; } } int index = ( int ) ( angle * SIN_COS_INDEXER + 0.5 ) ; double delta = ( angle - index * SIN_COS_DELTA_HI ) - index * SIN_COS_DELTA_LO ; index &= ( SIN_COS_TABS_SIZE - 2 ) ; double indexSin = sinTab [ index ] ; double indexCos = cosTab [ index ] ; double result = indexSin + delta * ( indexCos + delta * ( - indexSin * ONE_DIV_F2 + delta * ( - indexCos * ONE_DIV_F3 + delta * indexSin * ONE_DIV_F4 ) ) ) ; sine . value = negateResult ? - result : result ; cosine . value = indexCos + delta * ( - indexSin + delta * ( - indexCos * ONE_DIV_F2 + delta * ( indexSin * ONE_DIV_F3 + delta * indexCos * ONE_DIV_F4 ) ) ) ; }
computes sine and cosine together , at the cost of . . . a dependency of this class with doublewrapper .
