Integration of OCCT 6.5.0 from SVN
[occt.git] / src / gp / gp_Elips2d.cxx
CommitLineData
7fd59977 1//File gp_Elips2d.cxx FID 30/10/90
2//Modif JCV 10/01/91
3
4#include <gp_Elips2d.ixx>
5
6void gp_Elips2d::Coefficients (Standard_Real& A,
7 Standard_Real& B,
8 Standard_Real& C,
9 Standard_Real& D,
10 Standard_Real& E,
11 Standard_Real& F) const
12{
13 Standard_Real DMin = minorRadius * minorRadius;
14 Standard_Real DMaj = majorRadius * majorRadius;
15 if (DMin <= gp::Resolution() && DMaj <= gp::Resolution()) {
16 A = B = C = D = E = F = 0.0;
17 }
18 else {
19 gp_Trsf2d T;
20 T.SetTransformation (pos.XAxis());
21 Standard_Real T11 = T.Value (1, 1);
22 Standard_Real T12 = T.Value (1, 2);
23 Standard_Real T13 = T.Value (1, 3);
24 if (DMin <= gp::Resolution()) {
25 A = T11 * T11; B = T12 * T12; C = T11 * T12;
26 D = T11 * T13; E = T12 * T13; F = T13 * T13 - DMaj;
27 }
28 else {
29 Standard_Real T21 = T.Value (2, 1);
30 Standard_Real T22 = T.Value (2, 2);
31 Standard_Real T23 = T.Value (2, 3);
32 A = (T11 * T11 / DMaj) + (T21 * T21 / DMin);
33 B = (T12 * T12 / DMaj) + (T22 * T22 / DMin);
34 C = (T11 * T12 / DMaj) + (T21 * T22 / DMin);
35 D = (T11 * T13 / DMaj) + (T21 * T23 / DMin);
36 E = (T12 * T13 / DMaj) + (T22 * T23 / DMin);
37 F = (T13 * T13 / DMaj) + (T23 * T23 / DMin) - 1.0;
38 }
39 }
40}
41
42void gp_Elips2d::Mirror (const gp_Pnt2d& P)
43{ pos.Mirror(P); }
44
45gp_Elips2d gp_Elips2d::Mirrored (const gp_Pnt2d& P) const
46{
47 gp_Elips2d E = *this;
48 E.pos.Mirror (P);
49 return E;
50}
51
52void gp_Elips2d::Mirror (const gp_Ax2d& A)
53{ pos.Mirror(A); }
54
55gp_Elips2d gp_Elips2d::Mirrored (const gp_Ax2d& A) const
56{
57 gp_Elips2d E = *this;
58 E.pos.Mirror (A);
59 return E;
60}
61