Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

rsdl_dist.h File Reference


Detailed Description

Point to point and point to bounding box distance functions.

Author:
Chuck Stewart
Date:
June 2001
Distance functions for rsdl points and bounding boxes. These points and bounding boxes have a mixture of cartesian and angular coordinates, so the computation is a little more complicated than ordinary Euclidean distance calculations. Angles are treated in a full 2*pi range, so that the maximum distance between two angles is pi. Also, bounding intervals on angles can be such that the numerical value on the "min" angle is greater than the numerical value on the "max" angle. These are values that wrap-around 0.

Two assumptions are important. First, it is assumed that all angles are truly within a 2*pi range; it doesn't matter which. This is an implementation (and efficiency) convenience. Second, any normalization for comparing angle and cartesian distance measures has already been done.

Definition in file rsdl_dist.h.

#include <rsdl/rsdl_point.h>
#include <rsdl/rsdl_bounding_box.h>

Go to the source code of this file.

Functions

double rsdl_dist_sq (const rsdl_point &p, const rsdl_point &q)
 Return the square distance between two rsdl_point's.
double rsdl_dist (const rsdl_point &p, const rsdl_point &q)
 Return the distance between two rsdl_point's.
double rsdl_dist_sq (const rsdl_point &p, const rsdl_bounding_box &b)
 Return the minimum square distance between p and any point in b.
double rsdl_dist (const rsdl_point &p, const rsdl_bounding_box &b)
 Return the minimum distance between p and any point in b.
bool rsdl_dist_point_in_box (const rsdl_point &pt, const rsdl_bounding_box &box)
 Determine if a point is inside a bounding box.
void rsdl_dist_box_relation (const rsdl_bounding_box &inner, const rsdl_bounding_box &outer, bool &inside, bool &intersects)
 Determine the relation between a proported "inner" box and a proported "outer" box.


Function Documentation

double rsdl_dist const rsdl_point p,
const rsdl_bounding_box b
 

Return the minimum distance between p and any point in b.

Definition at line 80 of file rsdl_dist.cxx.

double rsdl_dist const rsdl_point p,
const rsdl_point q
 

Return the distance between two rsdl_point's.

Definition at line 33 of file rsdl_dist.cxx.

void rsdl_dist_box_relation const rsdl_bounding_box inner,
const rsdl_bounding_box outer,
bool &  inside,
bool &  intersects
 

Determine the relation between a proported "inner" box and a proported "outer" box.

inside will be true iff all points in inner are in outer intersect will be true iff at least one point from inner is in outer.

Definition at line 116 of file rsdl_dist.cxx.

bool rsdl_dist_point_in_box const rsdl_point pt,
const rsdl_bounding_box box
 

Determine if a point is inside a bounding box.

Definition at line 87 of file rsdl_dist.cxx.

double rsdl_dist_sq const rsdl_point p,
const rsdl_bounding_box b
 

Return the minimum square distance between p and any point in b.

Definition at line 40 of file rsdl_dist.cxx.

double rsdl_dist_sq const rsdl_point p,
const rsdl_point q
 

Return the square distance between two rsdl_point's.

Definition at line 8 of file rsdl_dist.cxx.


Generated on Thu Jan 10 14:49:34 2008 for contrib/rpl/rsdl by  doxygen 1.4.4