/*
 * SUMMARY:      CalcDistance.c - Calculate the distance between two points
 * USAGE:        Part of DHSVM
 *
 * AUTHOR:       Bart Nijssen
 * ORG:          University of Washington, Department of Civil Engineering
 * E-MAIL:       nijssen@u.washington.edu
 * ORIG-DATE:    Apr-96
 * Last Change: Wed Jan 27 22:57:54 1999 by Bart Nijssen <nijssen@u.washington.edu>
 * DESCRIPTION:  Calculates a simple "pythagorean" distance between two
 *               locations 
 * DESCRIP-END.
 * FUNCTIONS:    CalcDistance()
 * COMMENTS:     
 */

#ifndef lint
static char vcid[] = "$Id: CalcDistance.c,v 1.2 2001/03/31 00:10:19 waichler Exp $";
#endif /* lint */

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "settings.h"
#include "data.h"
#include "functions.h"

double CalcDistance(COORD *LocA, COORD *LocB)
{
  double Distance;
  double dN = (double)(LocA->N-LocB->N);
  double dE = (double)(LocA->E-LocB->E);
  Distance = sqrt(dN*dN + dE*dE);
/*   Distance = sqrt(pow((double)(LocA.N-LocB.N), (double) 2.0) + */
/* 		  pow((double)(LocA.E-LocB.E), (double) 2.0)); */

  return Distance;
} 
	
