Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- typedef struct {
- float x;
- float y;
- }punto2D;
- float modulo(punto2D a,punto2D b);
- int main()
- {
- punto2D p1,p2;
- p1.x=2;
- p1.y=3;
- p2.x=4;
- p2.y=6;
- printf("%.2f",modulo(p1,p2));
- return 0;
- }
- float modulo(punto2D a, punto2D b){
- return pow( pow(b.x - a.x,2)+pow(b.y - a.y,2) ,0.5);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement