calculate denominator
denominator = 1 ; toggle = -1 ; for ( int i = 2 ; i <= n ; i += 2 ) { numerator = numerator + nCr [ n ] [ i ] * pow ( tanTheta , i ) * toggle ; toggle = toggle * -1 ; } ans = numerator / denominator ; return ans ; }