Programs to Compute Trig Functions in Python, JavaScript, & Perl (with Maclaurin Series)
Have you ever wondered how your computer calculates certain mathematical functions, like division, or trigonometric functions like sine or cosine? Well, for some of these mathematical functions, there exist useful formulas to calculate very accurate results pretty easily. I've written programs to implement these two computations in three major scripting languages: Python, JavaScript, and Perl. These programs do not include any built-in trig functions or other utilities except the use of the in-built π constant in some cases. All code is CC0 licensed. The approach I used creates a generalized function called computeSeries which takes in x as the number
Tags: python, javascript, perl, math