+ 1
How can I write a function to find natural of sine,cos and tan for any given angle?
5 Réponses
+ 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)
+ 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
+ 1
Jayakrishna🇮🇳 but I want to write it from scratch.
+ 1
Hope this helps...
https://www.homeschoolmath.net/teaching/sine_calculator.php
0
Use series expansions for approximating.