helloworld:algorithms:geometrie
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
helloworld:algorithms:geometrie [2020/11/27 10:33] – Ajout de "Calculer la droite perpendiculaire à une droite passant par un point" root | helloworld:algorithms:geometrie [2020/12/01 09:29] (Version actuelle) – Ajout de "Calculer la distance entre une ligne et un point" root | ||
---|---|---|---|
Ligne 105: | Ligne 105: | ||
La ligne perpendiculaire à (x1, y1) et (x2, y2) passant par (x3, y3) est la droite (x3, y3) et (x4, y4) | La ligne perpendiculaire à (x1, y1) et (x2, y2) passant par (x3, y3) est la droite (x3, y3) et (x4, y4) | ||
- | < | + | $k = ((y2-y1) * (x3-x1) - (x2-x1) * (y3-y1)) / ((y2-y1)^2 + (x2-x1)^2)$ |
- | k = ((y2-y1) * (x3-x1) - (x2-x1) * (y3-y1)) / ((y2-y1)^2 + (x2-x1)^2) | + | |
- | x4 = x3 - k * (y2-y1) | + | $x4 = x3 - k * (y2-y1)$ |
- | y4 = y3 + k * (x2-x1) | + | |
- | </ | + | $y4 = y3 + k * (x2-x1)$ |
[[https:// | [[https:// | ||
+ | |||
+ | ===Calculer la distance entre une ligne et un point=== | ||
+ | |||
+ | Soit (x0, y0) et (x1, y1) la droite et (x, y) le point en dehors de la droite. | ||
+ | |||
+ | $$\frac{|(y_0-y_1)x+(x_1-x_0)y+x_0 y_1-x_1 y_0|}{\sqrt{(x_1-x_0)^2+(y_1-y_0)^2}}$$ | ||
+ | |||
+ | [[https:// |
helloworld/algorithms/geometrie.1606469589.txt.gz · Dernière modification : 2020/11/27 10:33 de root