Inscription / Connexion Nouveau Sujet

1 2 +


Niveau seconde
Partager :

algorithme?

Posté par
michael-corleon
27-01-10 à 17:15

bonjour voici l'exo:

1) ** exercice effacé ** (Lien cassé)

2) ** exercice effacé ** algorithme?

3) Écrire un algorithme permettant de construire un carré connaissant deux sommets consécutifs de ce
carré.

4) ** exercice effacé ** algorithme?


*** message dupliqué ***

Edit Coll : topic dupliqué, merci de respecter la FAQ, un problème = un topic

Posté par
Louisa59
re : algorithme? 19-08-10 à 20:15

Bonsoir

Allez zou ! C'est pour bibi

On commence de quelle manière ?

Merci

Posté par
Daniel62
re : algorithme? 19-08-10 à 20:29

Bonsoir Louisa

on commence par le début: l'entrée des données:

coordonnées des 2 sommets:

  A(x1;y1)  et B(x2;y2)

Posté par
Daniel62
re : algorithme? 19-08-10 à 20:46

après il faut réfléchir

comment trouver les coordonnées de C et D ?

on sait que ABCD est un carré

donc AB = BC = CD = DA

AB CD

AD BC

AB AD

AB BC

CD AD

CD BC

Posté par
Louisa59
re : algorithme? 19-08-10 à 20:58

Bonsoir Daniel

je vais tenter de remonter la pente, enfin mon moral

les variables :

sommet A
sommet B

dans un repère ? de mieux en mieux

Posté par
Louisa59
re : algorithme? 19-08-10 à 21:02

beurk !

x1 doit être différent de 2 et y1 différent de y2

Posté par
Louisa59
re : algorithme? 19-08-10 à 21:02

de x2

Posté par
Daniel62
re : algorithme? 19-08-10 à 21:03

j'ai supposé dans un repère oui

comment faire autrement ?

j'ai pas encore regardé comment on dessine avec Algobox,

si on arrive à calculer les coordonnées des 2 autres sommets,

je suppose qu'on pourra dessiner le carré.


A et B doivent être distincts

mais x1 peut être égal à x2

Posté par
Louisa59
re : algorithme? 19-08-10 à 21:04

je commence mal

Posté par
Daniel62
re : algorithme? 19-08-10 à 21:06

x1 peut être égal à x2 si y1 y2

(A et B sont une même verticale)

et

y1 peut être égal à y2 si x1 x2

(A et B sont sur une même horizontale)

Posté par
Daniel62
re : algorithme? 19-08-10 à 21:11

côté du carré = AB = BC = CD = DA

on connait les coordonnées de A et de B

on peut calculer la distance AB

(en fonction de x1,y1,x2,y2)

c'est déjà ça !

Posté par
Louisa59
re : algorithme? 19-08-10 à 21:13

pour la distance AB on fait:  (x2 - x1) + (y2 - y1)

Posté par
Daniel62
re : algorithme? 19-08-10 à 21:15

c'est Pythagore

AB est l'hypoténuse d'un rectangle ...

AB² = (x2 - x1)² + (y2 - y1)²

Posté par
Louisa59
re : algorithme? 19-08-10 à 21:17

d'un rectangle ?

pour Pythagore je savais zut !

Posté par
Daniel62
re : algorithme? 19-08-10 à 21:20

on a donc la longueur du côté du carré:

côté = ((x2 - x1)² + (y2 - y1)²)

après ça se complique ...

tu as une idée ?

je pense à l'équation de la droite AB

Posté par
Louisa59
re : algorithme? 19-08-10 à 21:24

équation de droite de la forme y = ax + b

tu penses pas à un système ?

Posté par
Daniel62
re : algorithme? 19-08-10 à 21:26

je pense qu'à partir de l'équation de la droite AB

on pourra connaître les autres

   BC , AD , DC

mais ça n'a pas l'air facile ...

Posté par
Daniel62
re : algorithme? 19-08-10 à 21:31

équation de la droite AB:

y = ax + b

un système pour trouver a et b

   y1 = ax1 + b
   y2 = ax2 + b
--------------------

Posté par
Louisa59
re : algorithme? 19-08-10 à 21:37

bah !

comment on fait ça ?

b = (y1 + y2 - ax1 - ax2) / 2

lol:

Posté par
Daniel62
re : algorithme? 19-08-10 à 21:41

on soustrait:

1   y1 = ax1 + b
2   y2 = ax2 + b
--------------------
2-1  (y2-y1) = a(x2-x1)

a= (y2-y1)/(x2-x1)

Posté par
Daniel62
re : algorithme? 19-08-10 à 21:45

b = y1 - ax1

b = y1 - x1*(y2-y1)/(x2-x1)

b = y1*(x2-x1) - x1*(y2-y1)/(x2-x1

b = (x2y1 - x1y1 - x1y2 + x1y1) / (x2-x1)

b = (x2y1 - x1y2) / (x2-x1)

c'est bon ou pas ?

Posté par
Louisa59
re : algorithme? 19-08-10 à 21:45

y1 = [(y2 - y1)/(x2-x1)] * x1 + b

l'horreur

Posté par
Louisa59
re : algorithme? 19-08-10 à 21:46

Je te crois sur parole

Posté par
Daniel62
re : algorithme? 19-08-10 à 21:52

a = (y2-y1)/(x2-x1
b = (x2y1 - x1y2) / (x2-x1)

équation de AB:

  y(AB) = (y2-y1)/(x2-x1) * x + )/(x2-x1)

  y(AB) = [(y2-y1)*x + (x2y1-x1y2)] / (x2-x1)

à vérifier ...

Posté par
Louisa59
re : algorithme? 19-08-10 à 21:56

pas compris là : y(AB) = [(y2-y1)*x + (x2y1-x1y2)] / (x2-x1)

Posté par
Daniel62
re : algorithme? 19-08-10 à 21:57

y(AB) = équation de la droite AB

de la forme ax + b

avec:

  a = (y2-y1)/(x2-x1)
  b = (x2y1 - x1y2) / (x2-x1)

Posté par
Louisa59
re : algorithme? 19-08-10 à 22:02

ok !

Posté par
Daniel62
re : algorithme? 19-08-10 à 22:12

y(BC) = équation de la droite BC

de la forme a2*x + b2

avec:

  a2 = -(x2-x1)/(y2-y1)

  b2 = (x2² + y2² - y1y2 - x1x2) / (y2-y1)

y(BC) = -(x2-x1)*x/(y2-y1) + (x2² + y2² - y1y2 - x1x2) / (y2-y1)

y(BC) = [-(x2-x2)x + (x2² + y2² - y1y2 - x1x2)] / (y2-y1)


je suis pas sûr ...

Posté par
Louisa59
re : algorithme? 19-08-10 à 22:15

oh la la !

le temps que je comprenne déjà ça

Posté par
Daniel62
re : algorithme? 19-08-10 à 22:17

on cherche les coordonnées du point C

il se trouve sur la droite (BC)

   (on connait l'équation)

et on connait la distance:

   BC = côté

Posté par
Daniel62
re : algorithme? 19-08-10 à 22:20

soit C(x,y)

BC = [(x-x2)² + (y-y2)²] = côté

y = [-(x2-x2)x + (x2² + y2² - y1y2 - x1x2)] / (y2-y1)


il faut trouver x et y

Posté par
Louisa59
re : algorithme? 19-08-10 à 22:25



Posté par
Daniel62
re : algorithme? 19-08-10 à 22:27

c'est pas encore la programmation ...

on est seulement dans l'analyse du problème

Posté par
Louisa59
re : algorithme? 19-08-10 à 22:28



très drôle

Posté par
Louisa59
re : algorithme? 19-08-10 à 22:32

des nombres à la place des lettres, ça serait mieux, tous ces x1, x2² ...

je rame

Posté par
Daniel62
re : algorithme? 19-08-10 à 22:34

j'ai

x = [y*y1 - y*y2 - y1y2 + y2² - x1x2 - x2²] /(x2  -x1)

    

Posté par
Louisa59
re : algorithme? 19-08-10 à 22:35

tu dis quoi là ?

Posté par
Daniel62
re : algorithme? 19-08-10 à 22:35

d'accord je veux bien

Posté par
Louisa59
re : algorithme? 19-08-10 à 22:37

j'ai l'impression que tu as dit : "ouf !"

Posté par
Daniel62
re : algorithme? 19-08-10 à 22:38

comment tu le sais ?

Posté par
Louisa59
re : algorithme? 19-08-10 à 22:39

je le sens et en + la tête

A = (3 ; 7)

B = (5 ; 2)

Posté par
Louisa59
re : algorithme? 19-08-10 à 22:42

Distance AB

AB² = (5 - 3)² + (2 - 7)²

AB² = 4 + 25

AB = V29

on peut pas changer ?

Posté par
Daniel62
re : algorithme? 19-08-10 à 22:43

c² = (5-3)² + (7-2)²

c² = 4 + 25 = 29

c = 29

yes

on change

Posté par
Louisa59
re : algorithme? 19-08-10 à 22:49

oui mais je prends quoi ?

A = (3 ; 4)

B = (5 ; 6)

Distance AB = V8

Posté par
Daniel62
re : algorithme? 19-08-10 à 22:51

on le garde comme ça

AB = 8

AB = 22

Posté par
Daniel62
re : algorithme? 19-08-10 à 22:52

ça se simplifie:

y(AB) = x + 1

Posté par
Louisa59
re : algorithme? 19-08-10 à 22:52

Sinon j'avais

A = (3 ; 3)
B = (8 ; 8)

bon on garde l'autre allez!

Posté par
Louisa59
re : algorithme? 19-08-10 à 22:54

AB = 2V2

y(AB) = x + 1 =>

Posté par
Daniel62
re : algorithme? 19-08-10 à 22:55

y(BC) = -x + 11

Posté par
Daniel62
re : algorithme? 19-08-10 à 22:58

y(AB) = [(y2-y1)*x + (x2y1-x1y2)] / (x2-x1)

A = (3 ; 4)
B = (5 ; 6)

   4 = 3a + b
   6 = 5a + b
  ------------
   2 = 2a

  a=1
  b=4-3=1

y(AB) = x + 1

1 2 +




Vous devez être membre accéder à ce service...

Pas encore inscrit ?

1 compte par personne, multi-compte interdit !

Ou identifiez-vous :


Rester sur la page

Inscription gratuite

Fiches en rapport

parmi 1675 fiches de maths

Désolé, votre version d'Internet Explorer est plus que périmée ! Merci de le mettre à jour ou de télécharger Firefox ou Google Chrome pour utiliser le site. Votre ordinateur vous remerciera !