An warware: yanki na parallelogram

A cikin duniyar ilimin lissafi, yanki na daidaitaccen ra'ayi shine ainihin ra'ayi wanda aka yi amfani da shi sosai a aikace-aikace daban-daban, kamar gine-gine, injiniyanci, da ฦ™ira. Fahimta da ฦ™ididdige yanki na layi ษ—aya yana da mahimmanci don magance matsaloli masu yawa, kuma yana iya taimaka muku don godiya da kyau da ayyuka na siffofi na geometric. Don sauฦ™aฦ™e wannan aikin, za mu iya amfani da ikon Python, sanannen yaren shirye-shirye da aka sani da sauฦ™i da iya karantawa. A cikin wannan labarin, za mu binciko dabara don tantance yanki na parallelogram, rubuta lambar Python mataki-mataki don ฦ™ididdige shi, da kuma tattauna wasu ษ—akunan karatu da ayyuka masu alaฦ™a waษ—anda za su iya zama masu amfani ga matsalolin geometric iri ษ—aya.

Don farawa, bari mu fahimci dabarar nemo yanki na daidaici. Ana iya ฦ™ididdige yanki (A) ta hanyar ninka tushe (b) na daidaici da tsayinsa (h) kuma ana wakilta ta ta hanyar lissafi kamar haka:

A=b*h

Don aiwatar da wannan dabarar a cikin Python, zamu iya ฦ™irฦ™irar aikin da ke ษ—aukar tushe da tsayi azaman sigogin shigarwa. Anan ga bayanin mataki-mataki na lambar da ke ฦ™ididdige yanki na daidaici:

def area_of_parallelogram(base, height):
    area = base * height
    return area

A cikin lambar da ke sama, mun ayyana wani aiki mai suna `yankin_parallelogram`, wanda ke ษ—aukar gardamar shigarwa guda biyu: `tushe` da `tsawo`. A cikin aikin, muna ฦ™ididdige wurin ta hanyar ninka ฦ™imar 'tushe' da 'tsawo', sannan mu adana sakamakon a cikin maษ“alli mai suna 'yanki'. A ฦ™arshe, muna mayar da ฦ™imar 'yankin' ga mai kira.

Yanzu, bari mu tattauna wasu dakunan karatu da ayyuka masu alaฦ™a waษ—anda zasu iya zama da amfani yayin da ake fuskantar matsalolin geometric.

m

m (gajeren "Python Lambobi") ษ—akin karatu ne mai ฦ™arfi kuma ana amfani da shi sosai don yin ayyukan lambobi da aiki tare da tsararraki masu girma dabam. Yana ba da ayyuka masu amfani da yawa don algebra na layi, haษ—a lamba, da haษ“akawa. ฦŠayan aikin da za a iya amfani da shi don ฦ™ididdige yanki na daidaici shine aikin 'cross' na numpy, wanda ke ฦ™ididdige samfurin giciye na vector biyu. Samfurin giciye na iya samar da yankin layi daya da waษ—annan vectors suka kirkira.

tausayi

tausayi wani ษ—akin karatu ne wanda zai iya taimakawa wajen magance matsalolin geometric. Laburaren buษ—ewa ne na Python don lissafi na alama wanda zai iya sauฦ™aฦ™a kalmomin algebra, warware daidaito, aiwatar da ayyukan ฦ™ididdiga, da ฦ™ari mai yawa. Tare da tausayawa, zaku iya sauri ayyana da sarrafa maganganun alamomi masu alaฦ™a da lissafi, gami da gano yanki na siffofi daban-daban.

Ga misali na ฦ™ididdige yanki na daidaici ta amfani da tausayi:

from sympy import symbols, Eq, solve

base, height, area = symbols('b h A')

eq = Eq(area, base * height)

area_formula = solve(eq, area)[0]

A ฦ™arshe, fahimtar yankin layi ษ—aya yana da mahimmanci ga aikace-aikacen lissafi daban-daban. Python, tare da dakunan karatu masu ฦ™arfi kamar ฦ™ididdigewa da tausayi, yana sauฦ™aฦ™a ฦ™ididdige yanki na daidaici da magance matsalolin geometric masu alaฦ™a. Yanzu da kuka san yadda ake nemo yankin layi ษ—aya ta amfani da Python, zaku iya amfani da waษ—annan ฦ™warewar don magance wasu ฦ™alubalen geometric ko haษ—a su da ilimin ku na ฦ™irar ฦ™irar ฦ™ira mai ban sha'awa kuma daidaitattun daidaito.

Shafi posts:

Leave a Comment