Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define DIAGONAL(xi,yi,xs,ys) (xs)-(xi)>=0 && (ys)-(yi)>=0?\
- sqrt(((xs)-(xi))*((xs)-(xi))+((ys)-(yi))*((ys)-(yi))):\
- 0
- ----------- APLICADA ------------
- #include <stdio.h>
- #include <math.h>
- #define DELTA 0
- #define DIAGONAL(xi,yi,xs,ys) (xs)-(xi)>=0 && (ys)-(yi)>=0?\
- sqrt(((xs)-(xi))*((xs)-(xi))+((ys)-(yi))*((ys)-(yi))):\
- 0
- int main()
- {
- int x1,y1,x2,y2;
- x1 = 2;
- y1 = 1;
- x2 = 1;
- y2 = 2;
- printf("La distancia de la punta (%d,%d) hasta la punta (%d,%d) es %g\n", x1,y1,x2+DELTA,y2+DELTA, DIAGONAL(x1,y1,x2+DELTA,y2+DELTA));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement