Ayyukan digiri () Math Module a Python kayan aiki ne mai ฦarfi wanda ke ba ku damar sauya radians zuwa digiri cikin sauri kuma daidai. Bukatar canzawa tsakanin waษannan raka'a biyu ya zama ruwan dare a fagage daban-daban, gami da lissafi, kimiyyar lissafi, da injiniyanci. A cikin wannan labarin, za mu nutse cikin zurfin aikin digiri (), yanayin amfani da shi, da yadda yake aiki. Za mu kuma ba da kwatanci mataki-mataki na aiwatar da shi a cikin lamba kuma za mu tattauna wasu ayyuka masu alaฦa da ษakunan karatu waษanda za su iya taimaka muku a cikin ฦoฦarin ku na ilimin lissafi.
Gabatarwa
Juyawa tsakanin radians da digiri wani muhimmin bangare ne na duka asali da kuma ci-gaban lissafi. Radians da digiri raka'a ne na ma'auni don kusurwoyi, kuma ana amfani da su don bayyana girman juyawar da'irar. Duk da yake ana san digiri da fahimta sosai, radians suna ba da hanyar da ta dace ta lissafi ta wakiltar kusurwoyi da yin ฦididdiga mafi ฦwarewa da madaidaiciya.
Module Math na Python ya ฦunshi ginannen ciki digiri() aikin da zai iya ษaukar kwana a cikin radians azaman shigarwa kuma ya dawo da daidai ฦimarsa a cikin digiri. Wannan aikin yana sauฦaฦa tsarin jujjuya kusurwa don masu shirye-shirye kuma yana kawar da ฦididdige ฦididdiga na hannu.
Aiwatar da aikin digiri()
Don amfani da aikin digiri () a Python, kuna buฦatar shigo da ilimin lissafi module farko. Da zarar an shigo da tsarin, kuna da damar zuwa aikin digiri() da duk sauran ayyukan lissafin da ke ฦunshe a cikin tsarin. Anan ga yadda zaku iya amfani da aikin digiri():
import math radians = 1.57 degrees = math.degrees(radians) print(degrees)
A cikin wannan misali, muna shigo da tsarin lissafi kuma mu sanya kusurwa a cikin radians (1.57) zuwa 'radians' masu canzawa. Sai mu yi amfani da digiri() aiki don canza kusurwa zuwa digiri kuma adana sakamakon a cikin 'digiri' masu canzawa. A ฦarshe, muna buga sakamakon.
Fahimtar Code
Bari mu zurfafa cikin kowane mataki don tabbatar da cewa mun fahimci yadda lambar ke aiki.
1. Shigo da tsarin lissafi: Ta shigo da tsarin lissafi, muna samun dama ga aikin digiri() ban da sauran ayyukan lissafi masu yawa.
import math
2. Sanya kusurwa a cikin radians: Muna adana kusurwar a cikin radians (1.57) a cikin ma'anar "radians."
radians = 1.57
3. Yi amfani da aikin digiri(): Muna amfani da aikin digiri () don canza kusurwar radians zuwa digiri kuma adana sakamakon a cikin "digiri".
degrees = math.degrees(radians)
4. Buga sakamakon: Muna buga kusurwar da aka canza a digiri (digiri 89.954).
print(degrees)
Ayyuka masu alaฦa da ษakunan karatu
Module na Lissafi yana ba da fiye da aikin digiri() kawai. Akwai wasu ayyuka masu alaฦa da ษakunan karatu waษanda zasu iya taimaka muku yin lissafin lissafi daban-daban.
- math.radians(): Wannan aikin yana canza kwana daga digiri zuwa radians. Yana da sabanin aikin digiri() kuma yana ba da damar juyawa gaba da gaba tsakanin radians da digiri.
- math.sin(), math.cos(), math.tan(): Waษannan ayyukan trigonometric suna ษaukar kusurwoyi a cikin radians azaman shigarwa kuma suna dawo da sine, cosine, da tangent na kwana, bi da bi. Ana iya haษa su tare da ayyukan digiri () da radians () lokacin da ake buฦata.
- nusaiba: Shahararren ษakin karatu don ฦididdige ฦididdiga a Python, numpy yana ba da ayyuka daban-daban na lissafi da kuma tsarin bayanai wanda ke sauฦaฦe aiwatar da hadaddun ayyuka na lissafi.
A ฦarshe, aikin digiri () Math Module a Python yana da matukar amfani ga juyar da radians zuwa digiri. Yana da sauฦi don aiwatarwa kuma yana taimakawa sosai a cikin aikace-aikacen lissafi daban-daban. Ayyuka masu alaฦa kamar math.radians() da dakunan karatu kamar numpy suna ฦara haษaka ikon yin ayyukan lissafi a Python.