How can I write a function to find natural of sine,cos and tan for any given angle? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How can I write a function to find natural of sine,cos and tan for any given angle?

8th May 2022, 11:00 AM
Even Dead I Am The Hero.
Even Dead I Am The Hero. - avatar
5 Answers
+ 2
math module has sin function. You can import and use it. from math import sin print( sin( 90 ) ) math module has all basics methods.. edit: Even Dead I Am The Hero. edited question? for others.. import math math.sin(90) math.cos(90) math.tan(90)
8th May 2022, 11:13 AM
Jayakrishna 🇮🇳
+ 2
Why would you do that? is it for an assignment? I thought coding was done to solve a problem, not create one...and those functions already exists. Why reinvent the wheel? Ok, if you must, then maybe you could look at the source code and see how it is written. Or try to translate the math formula into python code on your own, if you want to practice. Obligatory Stackoverflow link: (Because people would rather ask rather than Google:) https://stackoverflow.com/questions/67556351/trigonometric-functions-how-do-i-write-sine-and-cosine-functions-code-without
8th May 2022, 12:32 PM
Bob_Li
Bob_Li - avatar
+ 1
Jayakrishna🇮🇳 but I want to write it from scratch.
8th May 2022, 12:25 PM
Even Dead I Am The Hero.
Even Dead I Am The Hero. - avatar
8th May 2022, 12:43 PM
Jayakrishna 🇮🇳
0
Use series expansions for approximating.
8th Aug 2022, 8:43 PM
Bonsai
Bonsai - avatar