begin process at 2012 05 23 23:46:53
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Application complète

 > CALCUL DE LA FORCE EN NEWTON DE L'INTERACTION GRAVITATIONELLE

CALCUL DE LA FORCE EN NEWTON DE L'INTERACTION GRAVITATIONELLE


 Information sur la source

Note :
5 / 10 - par 2 personnes
5,00 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Application complète Classé sous :newton, calcul, gravitation, force, gravité Niveau :Débutant Date de création :17/04/2005 Vu :14 601

Auteur : tinux

Ecrire un message privé
Site perso
Ce membre participe au partage de revenus publicitaires
Commentaire sur cette source (4)
Ajouter un commentaire et/ou une note


 Description

Cliquez pour voir la capture en taille normale
Lol ça peut servir :

- Vous entrez la Masse d'un Objet.
- Vous entrez la Masse d'un Deuxième Objet.
- Vous entrez la distance entre ces deux objets.

Le programme vous donne la valeur de la Force exercée par ces deux objets, idéal pour les étudiants !

Source

  • #! /usr/bin/env python
  • from Tkinter import *
  • from math import *
  • #Définition
  • def calculer():
  • txt5.configure(text = "Résultat =" + str((6.67e-11)*(float(entr1.get()))*(float(entr2.get()))/((float(entr3.get()))**2)))
  • #Programme Principal
  • fen1 = Tk()
  • fen1.title("Calcul de la Force d'Interaction Gravitationelle by R.GUILLOT")
  • fen1.geometry('500x300')
  • #Listing des objets
  • txt1 = Label(fen1, text = "Entrez ici la Masse de l'élément A (kg) :")
  • txt2 = Label(fen1, text = "Entrez ici la Masse de l'élément B (kg) :")
  • txt3 = Label(fen1, text = "Entrez ici la distance entre A et B (m) :")
  • txt4 = Label(fen1, text = " ")
  • txt5 = Label(fen1)
  • entr1 = Entry(fen1)
  • entr2 = Entry(fen1)
  • entr3 = Entry(fen1)
  • button1 = Button(fen1, text='Quitter', command =fen1.quit)
  • button2 = Button(fen1, text='Calculer', command =calculer)
  • #Mise en place
  • txt1.grid(row=1, sticky=E)
  • txt2.grid(row=2, sticky=E)
  • txt3.grid(row=3, sticky=E)
  • txt4.grid(row=4, sticky=E)
  • txt5.grid(row=4, column =3)
  • entr1.grid(row=1, column =3)
  • entr2.grid(row=2, column =3)
  • entr3.grid(row=3, column =3)
  • button1.grid(row=5, column =1)
  • button2.grid(row=5, column =3)
  • fen1.mainloop()
#! /usr/bin/env python

from Tkinter import *
from math import *

#Définition

def calculer():
    txt5.configure(text = "Résultat =" + str((6.67e-11)*(float(entr1.get()))*(float(entr2.get()))/((float(entr3.get()))**2)))


    
#Programme Principal

fen1 = Tk()
fen1.title("Calcul de la Force d'Interaction Gravitationelle by R.GUILLOT")
fen1.geometry('500x300')

#Listing des objets

txt1 = Label(fen1, text = "Entrez ici la Masse de l'élément A (kg) :")
txt2 = Label(fen1, text = "Entrez ici la Masse de l'élément B (kg) :")
txt3 = Label(fen1, text = "Entrez ici la distance entre A et B (m) :")
txt4 = Label(fen1, text = " ")
txt5 = Label(fen1)
entr1 = Entry(fen1)
entr2 = Entry(fen1)
entr3 = Entry(fen1)
button1 = Button(fen1, text='Quitter', command =fen1.quit)
button2 = Button(fen1, text='Calculer', command =calculer)

#Mise en place

txt1.grid(row=1, sticky=E)
txt2.grid(row=2, sticky=E)
txt3.grid(row=3, sticky=E)
txt4.grid(row=4, sticky=E)
txt5.grid(row=4, column =3)
entr1.grid(row=1, column =3)
entr2.grid(row=2, column =3)
entr3.grid(row=3, column =3)
button1.grid(row=5, column =1)
button2.grid(row=5, column =3)


fen1.mainloop()




 Sources du même auteur

Source avec Zip EBAUCHE D'UN CALCULATEUR DE CONVERTION DES MOLES

 Sources de la même categorie

Source avec Zip Source avec une capture EDITEUR CROQUIS par grephit
Source avec Zip TV PROGRAM FETCHING AND PARSING FOR ANYONE WOULD KEEP TRACE ... par Senethril
Source avec une capture RECHERCHE DE DOUBLONS DANS DES DOSSIERS. par Rano Its
Source avec Zip Source avec une capture ILLUSTRATION DE SINUS ET DE COSINUS par calogerogigante
Source avec Zip Source avec une capture LE MOT LE PLUS LONG PAR DICO par Clempython

 Sources en rapport avec celle ci

CALCULATRICE LIGNE DE COMMANDE - CALCUL EXACT par Clempython
Source avec Zip Source avec une capture CALCUL MENTAL par chuugar
Source avec Zip Source avec une capture DIVISIONS AVEC PRÉCISION RÉGLABLE par Clempython
Source avec Zip Source avec une capture LE CALCULATOR DE RAYGOLD VERSION 3.1 par raygold
Source avec Zip Source avec une capture GRAVITATION UNIVERSELLE par Shakan972

Commentaires et avis

Commentaire de Thomas46 le 29/05/2005 21:31:37

Bon prog ;-)
Je note 9/10 car rien n'est parfait

Commentaire de Alexou69 le 29/08/2005 12:59:40

c'est sympa de recopier ce qu'on lit dans les bouquin !!!
(Cf. 'Apprendre à programmer avec Python' par G.Swinnen)
C'est une question de respect que de siter ces sources !!!

Commentaire de tinux le 07/09/2005 21:49:34

Cette source n'existe pas ds le tuto de Swinnen, j'ai appris Tkinter grace a Swinnen mai le prog est ma création. Il faut savoir observer une source !

Commentaire de tipro75 le 16/12/2005 19:07:42

c'est ce programe qui est sur 'aprendre a programer avec python" de plus je trouve celui qui est ci-des
ous plus sipas car y a une interface graphique donc 6.5/10

from Tkinter import *
from math import sqrt

def distance(x1, y1, x2, y2):
d = sqrt((x2-x1)**2 + (y2-y1)**2)
return d

def forceG(m1, m2, di):
return m1*m2*6.67e-11/di**2

def avance(n, gd, hb):
global x, y, step
x[n], y[n] = x[n] +gd, y[n] +hb
can.coords(astre[n], x[n]-10, y[n]-10, x[n]+10, y[n]+10)
di = distance(x[0], y[0], x[1], y[1])
diA = di*1e9
f = forceG(m1, m2, diA)
valDis.configure(text="Distance = " +str(diA) +" m")
valFor.configure(text="Force = " +str(f) +" N")
step = di/10

def gauche1():
avance(0, -step, 0)

def droite1():
avance(0, step, 0)

def haut1():
avance(0, 0, -step)

def bas1():
avance(0, 0, step)

def gauche2():
avance(1, -step, 0)

def droite2():
avance (1, step, 0)

def haut2():
avance(1, 0, -step)

def bas2():
avance(1, 0, step)


m1 = 6e24
m2 = 6e24
astre = [0]*2
x =[50., 350.]
y =[100., 100.]
step =10

fen = Tk()
fen.title(' Gravitation universelle suivant Newton')

valM1 = Label(fen, text="M1 = " +str(m1) +" kg")
valM1.grid(row =1, column =0)
valM2 = Label(fen, text="M2 = " +str(m2) +" kg")
valM2.grid(row =1, column =1)
valDis = Label(fen, text="Distance")
valDis.grid(row =3, column =0)
valFor = Label(fen, text="Force")
valFor.grid(row =3, column =1)

can = Canvas(fen, bg ="black", width =400, height =200)
can.grid(row =2, column =0, columnspan =2)
astre[0] = can.create_oval(x[0]-10, y[0]-10, x[0]+10, y[0]+10,fill ="red", width =1)
astre[1] = can.create_oval(x[1]-10, y[1]-10, x[1]+10, y[1]+10,fill ="blue", width =1)

fra1 = Frame(fen)
fra1.grid(row =4, column =0, sticky =W, padx =10)
Button(fra1, text="<-", fg ='red',command =gauche1).pack(side =LEFT)
Button(fra1, text="->", fg ='red', command =droite1).pack(side =LEFT)
Button(fra1, text="^", fg ='red', command =haut1).pack(side =LEFT)
Button(fra1, text="v", fg ='red', command =bas1).pack(side =LEFT)
fra2 = Frame(fen)
fra2.grid(row =4, column =1, sticky =E, padx =10)
Button(fra2, text="<-", fg ='blue', command =gauche2).pack(side =LEFT)
Button(fra2, text="->", fg ='blue', command =droite2).pack(side =LEFT)
Button(fra2, text="^", fg ='blue', command =haut2).pack(side =LEFT)
Button(fra2, text="v", fg ='blue', command =bas2).pack(side =LEFT)
fen.mainloop()


 Ajouter un commentaire


Discussions en rapport avec ce code source dans le forum

calcul matriciel [ par evelockertrue ] &nbsp;salut,j'ai pour projet de&nbsp;d&#233;velopper un package contenant des fonctions &#232;crites en python et qui serviront &#224; optimiser le ca calcul matriciel simple [ par gwenc_hlan ] bonjour,    comment peut on faire sous Python du calcul matriciel simple ? (additionner, multiplier ou inverser des matrices). faut - il impérativeme Problème de calcul simple [ par vaggarath ] Bonjour bonjour. Voilà j'ai un problème tout c*n, j'en suis sur... En fait je fais un boutton qui procède à un calcul suivant les valeurs rentrées au Django calcul de conversion [ par jenny100 ] bonjour voila mon probleme j'ai un template qui affiche un champ avec une valeur numerique et un bouton submit une liste deroulante qui permet la s


Nos sponsors


Sondage...

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 1,342 sec (4)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales