00001
00002 #ifndef vgl_distance_h_
00003 #define vgl_distance_h_
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include <vgl/vgl_fwd.h>
00026
00027
00028 template <class T>
00029 double vgl_distance2_to_linesegment(T x1, T y1,
00030 T x2, T y2,
00031 T x, T y);
00032
00033
00034 template <class T>
00035 double vgl_distance_to_linesegment(T x1, T y1,
00036 T x2, T y2,
00037 T x, T y);
00038
00039
00040 template <class T>
00041 double vgl_distance2_to_linesegment(T x1, T y1, T z1,
00042 T x2, T y2, T z2,
00043 T x, T y, T z);
00044
00045
00046 template <class T>
00047 double vgl_distance_to_linesegment(T x1, T y1, T z1,
00048 T x2, T y2, T z2,
00049 T x, T y, T z);
00050
00051
00052 template <class T>
00053 double vgl_distance_to_non_closed_polygon(T const px[], T const py[], unsigned int n,
00054 T x, T y);
00055
00056
00057 template <class T>
00058 double vgl_distance_to_non_closed_polygon(T const px[], T const py[], T const pz[], unsigned int n,
00059 T x, T y, T z);
00060
00061
00062 template <class T>
00063 double vgl_distance_to_closed_polygon(T const px[], T const py[], unsigned int n,
00064 T x, T y);
00065
00066
00067 template <class T>
00068 double vgl_distance_to_closed_polygon(T const px[], T const py[], T const pz[], unsigned int n,
00069 T x, T y, T z);
00070
00071
00072
00073 template <class T>
00074 double vgl_distance_origin(vgl_line_2d<T> const& l);
00075
00076
00077
00078 template <class T>
00079 double vgl_distance_origin(vgl_plane_3d<T> const& pl);
00080
00081
00082
00083 template <class T>
00084 double vgl_distance_origin(vgl_line_3d_2_points<T> const& l);
00085
00086
00087
00088 template <class T>
00089 double vgl_distance_origin(vgl_homg_line_2d<T> const& l);
00090
00091
00092
00093 template <class T>
00094 double vgl_distance_origin(vgl_homg_plane_3d<T> const& pl);
00095
00096
00097
00098 template <class T>
00099 double vgl_distance_origin(vgl_homg_line_3d_2_points<T> const& l);
00100
00101
00102
00103 template <class T> inline
00104 double vgl_distance(vgl_point_2d<T>const& p1,
00105 vgl_point_2d<T>const& p2) { return length(p2-p1); }
00106
00107
00108
00109 template <class T> inline
00110 double vgl_distance(vgl_point_3d<T>const& p1,
00111 vgl_point_3d<T>const& p2) { return length(p2-p1); }
00112
00113
00114
00115 template <class T>
00116 double vgl_distance(vgl_homg_point_1d<T>const& p1,
00117 vgl_homg_point_1d<T>const& p2);
00118
00119
00120
00121 template <class T> inline
00122 double vgl_distance(vgl_homg_point_2d<T>const& p1,
00123 vgl_homg_point_2d<T>const& p2) { return length(p2-p1); }
00124
00125
00126
00127 template <class T> inline
00128 double vgl_distance(vgl_homg_point_3d<T>const& p1,
00129 vgl_homg_point_3d<T>const& p2) { return length(p2-p1); }
00130
00131
00132
00133
00134 template <class T>
00135 double vgl_distance(vgl_line_2d<T> const& l,
00136 vgl_point_2d<T> const& p);
00137 template <class T> inline
00138 double vgl_distance(vgl_point_2d<T> const& p,
00139 vgl_line_2d<T> const& l) { return vgl_distance(l,p); }
00140
00141
00142
00143
00144 template <class T>
00145 double vgl_distance(vgl_homg_line_2d<T> const& l,
00146 vgl_homg_point_2d<T> const& p);
00147 template <class T> inline
00148 double vgl_distance(vgl_homg_point_2d<T> const& p,
00149 vgl_homg_line_2d<T> const& l) { return vgl_distance(l,p); }
00150
00151
00152
00153
00154 template <class T>
00155 double vgl_distance(vgl_plane_3d<T> const& l,
00156 vgl_point_3d<T> const& p);
00157 template <class T> inline
00158 double vgl_distance(vgl_point_3d<T> const& p,
00159 vgl_plane_3d<T> const& l) { return vgl_distance(l,p); }
00160
00161
00162
00163
00164 template <class T>
00165 double vgl_distance(vgl_homg_plane_3d<T> const& l,
00166 vgl_homg_point_3d<T> const& p);
00167 template <class T> inline
00168 double vgl_distance(vgl_homg_point_3d<T> const& p,
00169 vgl_homg_plane_3d<T> const& l) { return vgl_distance(l,p); }
00170
00171
00172
00173
00174
00175
00176 template <class T>
00177 double vgl_distance(vgl_polygon<T> const& poly,
00178 vgl_point_2d<T> const& point,
00179 bool closed=true);
00180
00181 template <class T> inline
00182 double vgl_distance(vgl_point_2d<T> const& point,
00183 vgl_polygon<T> const& poly,
00184 bool closed=true) { return vgl_distance(poly,point,closed); }
00185
00186
00187
00188
00189
00190 template <class T>
00191 double vgl_distance(vgl_homg_line_3d_2_points<T> const& line1,
00192 vgl_homg_line_3d_2_points<T> const& line2);
00193
00194
00195
00196
00197 template <class T>
00198 double vgl_distance(vgl_homg_line_3d_2_points<T> const& l,
00199 vgl_homg_point_3d<T> const& p);
00200
00201 template <class T> inline
00202 double vgl_distance(vgl_homg_point_3d<T> const& p,
00203 vgl_homg_line_3d_2_points<T> const& l) { return vgl_distance(l,p); }
00204
00205
00206
00207
00208 template <class T>
00209 double vgl_distance(vgl_line_3d_2_points<T> const& l,
00210 vgl_point_3d<T> const& p);
00211
00212 template <class T> inline
00213 double vgl_distance(vgl_point_3d<T> const& p,
00214 vgl_line_3d_2_points<T> const& l) { return vgl_distance(l,p); }
00215
00216
00217 template <class T>
00218 double vgl_distance(vgl_ray_3d<T> const& r,
00219 vgl_point_3d<T> const& p);
00220
00221 template <class T> inline
00222 double vgl_distance(vgl_point_3d<T> const& p,
00223 vgl_ray_3d<T> const& r) { return vgl_distance(r,p); }
00224
00225
00226
00227
00228
00229
00230 template <class T>
00231 double vgl_distance(vgl_line_segment_2d<T> const& l,
00232 vgl_point_2d<T> const& p);
00233 template <class T> inline
00234 double vgl_distance(vgl_point_2d<T> const& p,
00235 vgl_line_segment_2d<T> const& l) { return vgl_distance(l,p); }
00236
00237
00238
00239
00240
00241
00242
00243 template <class T>
00244 double vgl_distance(vgl_line_segment_3d<T> const& l,
00245 vgl_point_3d<T> const& p);
00246 template <class T> inline
00247 double vgl_distance(vgl_point_3d<T> const& p,
00248 vgl_line_segment_3d<T> const& l) { return vgl_distance(l,p); }
00249
00250
00251 #endif // vgl_distance_h_