/*
   File:        distutils.h
   Author:      Andrew W. Moore
   Created:     June 2000
   Description: Utilities for measuring metric distances between points
                and rectangles.

   Copyright 2000, Schenley Park Research
*/

#ifndef DISTUTILS_H

#include "hrect.h"

#define MIN_DIST 0
#define MAX_DIST 1
#define MID_DIST 2

extern int Num_pt_dists;
extern int Num_hr_dists;

double hrect_metric_dsqd(dyv *metric,hrect *a,hrect *b,int dist_type);
double hrect_metric_dist(dyv *metric,hrect *a,hrect *b,int dist_type);
double hrect_midpoint_metric_dsqd(dyv *metric,hrect *a,hrect *b);
double hrect_midpoint_metric_dist(dyv *metric,hrect *a,hrect *b);
double hrect_min_metric_dsqd(dyv *metric,hrect *a,hrect *b);
double hrect_max_metric_dsqd(dyv *metric,hrect *a,hrect *b);
double hrect_min_metric_dist(dyv *metric,hrect *a,hrect *b);
double hrect_max_metric_dist(dyv *metric,hrect *a,hrect *b);
double metric_dsqd(dyv *metric,dyv *x1,dyv *x2);
double row_metric_dsqd(dym *x1,dym *x2,dyv *metric,int row1,int row2);
double row_dyv_metric_dsqd(dym *x,dyv *metric,int row,dyv *query);
double hrect_dyv_metric_dsqd(dyv *metric,hrect *hr,dyv *x,int dist_type);
double hrect_dyv_min_metric_dsqd(dyv *metric,hrect *hr,dyv *x);
double hrect_dyv_max_metric_dsqd(dyv *metric,hrect *hr,dyv *x);

#endif

