Skip to content

Instantly share code, notes, and snippets.

@zmaril
Created March 9, 2013 17:10
Show Gist options
  • Save zmaril/5124868 to your computer and use it in GitHub Desktop.
Save zmaril/5124868 to your computer and use it in GitHub Desktop.
Approximation function for cosine
def cos(x):
i = 0
coefficents = [1,2,3,4,5]
y = 0;
while(i < coefficents.length){
y = y + (coefficents[i]*x^i)/factorial(i)
}
return y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment