ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/acismesh/m2d_ex_sol.cpp
Revision: 1
Committed: Mon Jun 11 22:53:07 2007 UTC (17 years, 11 months ago)
File size: 2464 byte(s)
Log Message:

File Contents

# Content
1 /*****************************************************************
2
3 m2d_ex_sol.c Type:Func
4
5 analyse les solutions de la recherche de l'intersection seg seg
6
7 Date de creation : Wed Feb 19 14:38:14 1997
8
9 Derniere version : Tue Apr 22 13:39:09 1997
10
11
12
13
14
15
16
17
18
19
20
21
22 Vincent FRANCOIS
23
24 *****************************************************************/
25
26
27
28
29
30 /**************************/
31 /* include */
32 #include <stdio.h>
33 #include <math.h>
34 #include "const.h"
35 #include "memoire.h"
36 #include "struct.h"
37 #include "prototype.h"
38
39 /**************************/
40 /* variables globales */
41
42
43
44 /**************************/
45 /* programme principal */
46 #define VRAI 1
47 #define FAUX 0
48
49 int m2d_ex_sol(float sol1,float sol2,int ntype_sol)
50 {
51 float epsilon=0.0001;
52
53 if (ntype_sol==1)
54 {
55 if ( (sol1>epsilon) && ((sol1)<(1-epsilon)) && (sol2>epsilon) && ((sol2)<(1-epsilon)) ) return(VRAI);
56 if ( ( (EGAL(sol1,0,epsilon)) || (EGAL(sol1,1,epsilon))) && ( (sol2>epsilon) && ((sol2)<(1-epsilon)) ) ) return(VRAI);
57 if ( ( (EGAL(sol2,0,epsilon)) || (EGAL(sol2,1,epsilon))) && ( (sol1>epsilon) && ((sol1)<(1-epsilon)) ) ) return(VRAI);
58 if ( (sol1>epsilon) && ((sol1)<(1-epsilon)) && (sol2>(-0.1-epsilon)) && ((sol2)<(1.1-epsilon)) ) return(VRAI);
59 if ( (sol2>epsilon) && ((sol2)<(1-epsilon)) && (sol1>(-0.1-epsilon)) && ((sol1)<(1.1-epsilon)) ) return(VRAI);
60
61 }
62 if (ntype_sol==2)
63 {
64 if ( (sol1>epsilon) && ((sol1)<(1-epsilon)) ) return(VRAI);
65 if ( (sol2>epsilon) && ((sol2)<(1-epsilon)) ) return(VRAI);
66 if ( ((sol1)>(1+epsilon)) && ((-sol2)>epsilon) ) return(VRAI);
67 if ( ((sol2)>(1+epsilon)) && ((-sol1)>epsilon) ) return(VRAI);
68 }
69 return(FAUX);
70 }