1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 //============================================ IntAna2d_AnaIntersection_5.cxx
16 //============================================================================
18 #include <gp_Circ2d.hxx>
19 #include <gp_Elips2d.hxx>
20 #include <gp_Hypr2d.hxx>
21 #include <gp_Lin2d.hxx>
22 #include <gp_Parab2d.hxx>
23 #include <IntAna2d_AnaIntersection.hxx>
24 #include <IntAna2d_Conic.hxx>
25 #include <IntAna2d_IntPoint.hxx>
26 #include <IntAna2d_Outils.hxx>
27 #include <Standard_OutOfRange.hxx>
28 #include <StdFail_NotDone.hxx>
30 void IntAna2d_AnaIntersection::Perform(const gp_Circ2d& Circle,
31 const IntAna2d_Conic& Conic)
33 Standard_Boolean CIsDirect = Circle.IsDirect();
34 Standard_Real A,B,C,D,E,F;
35 Standard_Real pcc,pss,p2sc,pc,ps,pcte;
36 Standard_Real radius=Circle.Radius();
37 Standard_Real radius_P2=radius*radius;
39 Standard_Real tx,ty,S;
41 done = Standard_False;
43 para = Standard_False;
44 empt = Standard_False;
45 iden = Standard_False;
47 gp_Ax2d Axe_rep(Circle.XAxis());
49 Conic.Coefficients(A,B,C,D,E,F);
50 Conic.NewCoefficients(A,B,C,D,E,F,Axe_rep);
52 // Parametre a avec x=Radius Cos(a) et y=Radius Sin(a)
55 pcc = A*radius_P2 - pss; // COS ^2
56 p2sc =C*radius_P2; // 2 SIN COS
57 pc = 2.0*D*radius; // COS
58 ps = 2.0*E*radius; // SIN
61 math_TrigonometricFunctionRoots Sol(pcc,p2sc,pc,ps,pcte,0.0,2.0*M_PI);
64 cout << "\n\nmath_TrigonometricFunctionRoots -> NotDone\n\n"<<endl;
69 if(Sol.InfiniteRoots()) {
74 nbp=Sol.NbSolutions();
79 Coord_Ancien_Repere(tx,ty,Axe_rep);
82 lpnt[i-1].SetValue(tx,ty,S);
84 Traitement_Points_Confondus(nbp,lpnt);