1 |
|
1 |
/*****************************************************************
|
2 |
|
|
|
3 |
|
|
eval_dis_edge_edge.cpp Type:Func
|
4 |
|
|
|
5 |
|
|
Calcul la distance entre deux edge
|
6 |
|
|
|
7 |
|
|
Date de creation : 2-2-1999 10 :11 :13
|
8 |
|
|
Derniere version : 2-2-1999 10 :11 :13
|
9 |
|
|
|
10 |
|
|
Vincent FRANCOIS
|
11 |
|
|
|
12 |
|
|
*****************************************************************/
|
13 |
|
|
|
14 |
|
|
|
15 |
|
|
|
16 |
|
|
|
17 |
|
|
|
18 |
|
|
/**************************/
|
19 |
|
|
/* include */
|
20 |
|
|
#include <stdio.h>
|
21 |
|
|
#include <string.h>
|
22 |
|
|
#include <math.h>
|
23 |
|
|
#include "struct.h"
|
24 |
|
|
#include "const.h"
|
25 |
|
|
#include "prototype.h"
|
26 |
|
|
|
27 |
|
|
/**************************/
|
28 |
|
|
/* variables globales */
|
29 |
|
|
extern struct s_acis *acis;
|
30 |
|
|
|
31 |
|
|
|
32 |
|
|
|
33 |
|
|
/**************************/
|
34 |
|
|
/* programme principal */
|
35 |
|
|
|
36 |
|
|
float eval_dis_edge_edge(struct s_edge *edge1,float t1,struct s_edge *edge2,float t2,int type)
|
37 |
|
|
{
|
38 |
|
|
float res;
|
39 |
|
|
float x1[4],x2[4];
|
40 |
|
|
|
41 |
|
|
|
42 |
|
|
if (type==FONCTION)
|
43 |
|
|
{
|
44 |
|
|
eval_edge(edge1,t1,FONCTION,x1);
|
45 |
|
|
eval_edge(edge2,t2,FONCTION,x2);
|
46 |
|
|
res=(x1[0]-x2[0])*(x1[0]-x2[0])+(x1[1]-x2[1])*(x1[1]-x2[1])+(x1[2]-x2[2])*(x1[2]-x2[2]);
|
47 |
|
|
}
|
48 |
|
|
return(res);
|
49 |
|
|
}
|