-
-
Save parzibyte/642d34f5b476bffc789c2b71fb060017 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
double calcularDistancia(int x1, int y1, int x2, int y2) | |
{ | |
/* | |
Aplicar la fórmula que dice: | |
distancia = raiz_cuadrada_de(elevar_al_cuadrado(x1-x2) + elevar_al_cuadrado(y1-y2)) | |
Nota: no importa el orden de los puntos ni si la distancia al restar es negativa | |
*/ | |
return sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment