Hey guys,
so I want to write a program that calculates the sinus, cosinus and tangent without using math library...
Any ideas?
alexa868 -2 Newbie Poster
Recommended Answers
Jump to PostHey guys,
so I want to write a program that calculates the sinus, cosinus and tangent without using math library...
Any ideas?SOHCAHTOA
Jump to PostWhat about a taylor series approximation... The theory is rooted in calculus, but you can probably manage by simply applying the formulae and ignoring the theory (FYI series and taylor approximations are typically covered in a Calc 2 course).
Here are the approximations (scroll down to the "series definition" …
Jump to PostSin(x) = x - x^3/3! + x^5/5! + x^7/7! ...
Cos(x) = 1 - x^2/2! + x^4/4! - x^6/6! ...
Cos(x) = Sin( x - 90 ) ; //assuming x is in degrees
Tan(x) = Sin(X)/cos(X)
"!" means factorial.for example to calculate Sinus you can do this :
…
All 10 Replies
ShawnCplus 456 Code Monkey Team Colleague
jonsca 1,059 Quantitative Phrenologist Team Colleague Featured Poster
alexa868 -2 Newbie Poster
jonsca 1,059 Quantitative Phrenologist Team Colleague Featured Poster
ShawnCplus 456 Code Monkey Team Colleague
jonsca 1,059 Quantitative Phrenologist Team Colleague Featured Poster
n1337 29 Junior Poster in Training
mrnutty 761 Senior Poster
nezachem 616 Practically a Posting Shark
mrnutty 761 Senior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.