GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
rst/interp_float/distance.c
Go to the documentation of this file.
1 
2 /*-
3  * Written by H. Mitasova, I. Kosinovsky, D. Gerdes Fall 1993
4  * US Army Construction Engineering Research Lab
5  * Copyright 1993, H. Mitasova (University of Illinois),
6  * I. Kosinovsky, (USA-CERL), and D.Gerdes (USA-CERL)
7  *
8  * modified by McCauley in August 1995
9  * modified by Mitasova in August 1995
10  *
11  */
12 
13 #include <stdio.h>
14 #include <math.h>
15 #include <unistd.h>
16 #include <grass/gis.h>
17 #include <grass/interpf.h>
18 
19 double IL_dist_square(double *pt1, double *pt2, int dim)
20 {
21  int i;
22  double sum = 0, s;
23 
24  for (i = 0; i < dim; i++) {
25  s = pt1[i] - pt2[i];
26  sum += s * s;
27  }
28  return sum;
29 }
double IL_dist_square(double *pt1, double *pt2, int dim)