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