1 -- File: Extrema_ExtElC2d.cdl
2 -- Created: Tue Jan 4 11:37:09 1994
3 -- Author: Christophe MARION
5 ---Copyright: Matra Datavision 1994
8 class ExtElC2d from Extrema
9 ---Purpose: It calculates all the distance between two elementary
11 -- These distances can be maximum or minimum.
18 POnCurv2d from Extrema
20 raises InfiniteSolutions from StdFail,
22 OutOfRange from Standard
25 Create returns ExtElC2d;
27 Create (C1,C2: Lin2d; AngTol: Real) returns ExtElC2d;
28 ---Purpose: Calculates the distance between two lines.
29 -- AngTol is used to test if the lines are parallel:
30 -- Angle(C1,C2) < AngTol.
32 Create (C1: Lin2d; C2: Circ2d; Tol: Real) returns ExtElC2d;
33 ---Purpose: Calculates the distance between a line and a
36 Create (C1: Lin2d; C2: Elips2d) returns ExtElC2d;
37 ---Purpose: Calculates the distance between a line and an
40 Create (C1: Lin2d; C2: Hypr2d) returns ExtElC2d;
41 ---Purpose: Calculates the distance between a line and a
44 Create (C1: Lin2d; C2: Parab2d) returns ExtElC2d;
45 ---Purpose: Calculates the distance between a line and a
48 Create (C1,C2: Circ2d) returns ExtElC2d;
49 ---Purpose: Calculates the distance between two circles.
50 -- The circles can be parallel or identical.
52 Create (C1: Circ2d; C2: Elips2d) returns ExtElC2d;
53 ---Purpose: Calculates the distance between a circle and an
56 Create (C1: Circ2d; C2: Hypr2d) returns ExtElC2d;
57 ---Purpose: Calculates the distance between a circle and a
60 Create (C1: Circ2d; C2: Parab2d) returns ExtElC2d;
61 ---Purpose: Calculates the distance between a circle and a
64 Create (C1,C2: Elips2d) returns ExtElC2d;
65 ---Purpose: Calculates the distance between two elipses.
66 -- The elipses can be parallel or identical.
68 Create (C1: Elips2d; C2: Hypr2d) returns ExtElC2d;
69 ---Purpose: Calculates the distance between an elipse and a
72 Create (C1: Elips2d; C2: Parab2d) returns ExtElC2d;
73 ---Purpose: Calculates the distance between an elipse and a
76 Create (C1,C2: Hypr2d) returns ExtElC2d;
77 ---Purpose: Calculates the distance between two hyperbolas.
78 -- The hyperbolas can be parallel or identical.
80 Create (C1: Hypr2d; C2: Parab2d) returns ExtElC2d;
81 ---Purpose: Calculates the distance between a hyperbola and a
84 Create (C1,C2: Parab2d) returns ExtElC2d;
85 ---Purpose: Calculates the distance between two parabolas
86 -- The parabolas can be parallel or identical.
88 IsDone (me) returns Boolean
89 ---Purpose: Returns True if the distances are found.
92 IsParallel (me) returns Boolean
93 ---Purpose: Returns True if the two curves are parallel.
94 raises NotDone from StdFail
95 -- if IsDone(me)=False.
98 NbExt (me) returns Integer
99 ---Purpose: Returns the number of extremum distances.
100 raises NotDone from StdFail,
101 -- if IsDone(me)=False.
102 InfiniteSolutions from StdFail
103 -- if IsParallel(me)= True.
106 SquareDistance (me; N: Integer =1) returns Real
107 ---Purpose: Returns the value of the Nth extremum square distance.
108 raises NotDone from StdFail,
109 -- if IsDone(me)=False.
110 InfiniteSolutions from StdFail,
111 -- if IsParallel(me)= True and N > 1.
112 OutOfRange from Standard
113 -- if N < 1 or N > NbExt(me)
116 Points (me; N: Integer; P1,P2: out POnCurv2d)
117 ---Purpose: Returns the points of the Nth extremum distance.
118 -- P1 is on the first curve, P2 on the second one.
119 raises NotDone from StdFail,
120 -- if IsDone(me)=False.
121 InfiniteSolutions from StdFail,
122 -- if IsParallel(me)= True.
123 OutOfRange from Standard
124 -- if N < 1 or N > NbExt(me)
132 myPoint: POnCurv2d from Extrema [4,2];