1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
-- File: TrigonometricFunctionRoots.cdl
-- Created: Tue Sep 3 16:46:25 1991
-- Author: Laurent PAINNOT
-- <lpa@topsn3>
---Copyright: Matra Datavision 1991, 1992
class TrigonometricFunctionRoots from math
---Purpose: This class implements the solutions of the equation
-- a*Cos(x)*Cos(x) + 2*b*Cos(x)*Sin(x) + c*Cos(x) + d*Sin(x) + e
-- The degree of this equation can be 4, 3 or 2.
uses Array1OfReal from TColStd,
OStream from Standard
raises NotDone from StdFail,
OutOfRange from Standard,
RangeError from Standard
is
Create(A, B, C, D, E: Real; InfBound, SupBound: Real)
---Purpose: Given coefficients a, b, c, d , e, this constructor
-- performs the resolution of the equation above.
-- The solutions must be contained in [InfBound, SupBound].
-- InfBound and SupBound can be set by default to 0 and 2*PI.
returns TrigonometricFunctionRoots;
Create(D, E: Real; InfBound, SupBound: Real)
---Purpose: Given the two coefficients d and e, it performs
-- the resolution of d*sin(x) + e = 0.
-- The solutions must be contained in [InfBound, SupBound].
-- InfBound and SupBound can be set by default to 0 and 2*PI.
returns TrigonometricFunctionRoots;
Create(C, D, E: Real; InfBound, SupBound: Real)
---Purpose: Given the three coefficients c, d and e, it performs
-- the resolution of 2*b*cos(x)*sin(x) + d*sin(x) + e = 0.
-- The solutions must be contained in [InfBound, SupBound].
-- InfBound and SupBound can be set by default to 0 and 2*PI.
returns TrigonometricFunctionRoots;
Perform(me: in out; A, B, C, D, E: Real; InfBound, SupBound: Real)
---Purpose: is used by the constructors above.
is static protected;
IsDone(me)
---Purpose: Returns true if the computations are successful, otherwise returns false.
---C++: inline
returns Boolean
is static;
InfiniteRoots(me)
---Purpose: Returns true if there is an infinity of roots, otherwise returns false.
---C++: inline
returns Boolean
is static;
Value(me; Index: Integer)
---Purpose: Returns the solution of range Index.
-- An exception is raised if NotDone.
-- An exception is raised if Index>NbSolutions.
-- An exception is raised if there is an infinity of solutions.
---C++: inline
returns Real
raises NotDone, OutOfRange, RangeError
is static;
NbSolutions(me)
---Purpose: Returns the number of solutions found.
-- An exception is raised if NotDone.
-- An exception is raised if there is an infinity of solutions.
---C++: inline
returns Integer
raises NotDone, RangeError
is static;
Dump(me; o: in out OStream)
---Purpose: Prints information on the current state of the object.
is static;
fields
NbSol: Integer;
Sol: Array1OfReal from TColStd;
InfiniteStatus: Boolean;
Done: Boolean;
end TrigonometricFunctionRoots;
|