Replaced lib math (cosine) with Taylor Series

To fix code space issues compiling under windows required removal of
math library(only cosine used) and replaced with 8th degree Taylor
series expansion for cosine.