1 // Created on: 1992-01-20
2 // Created by: Remi GILET
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
18 #include <Geom2dAdaptor_Curve.hxx>
19 #include <Geom2dGcc_CurveTool.hxx>
20 #include <Geom2dGcc_FunctionTanObl.hxx>
21 #include <gp_Dir2d.hxx>
22 #include <gp_Pnt2d.hxx>
23 #include <gp_Vec2d.hxx>
25 Geom2dGcc_FunctionTanObl::
26 Geom2dGcc_FunctionTanObl(const Geom2dAdaptor_Curve& C,
34 Standard_Boolean Geom2dGcc_FunctionTanObl::
35 Value (const Standard_Real X,
36 Standard_Real& Fval ) {
39 Geom2dGcc_CurveTool::D1(TheCurv,X,Point,Vect);
40 Standard_Real NormeD1 = Vect.Magnitude();
41 Fval = TheDirection.XY().Crossed(Vect.XY())/NormeD1;
45 Standard_Boolean Geom2dGcc_FunctionTanObl::
46 Derivative (const Standard_Real X,
47 Standard_Real& Deriv )
52 Geom2dGcc_CurveTool::D2(TheCurv,X,Point,Vec1,Vec2);
53 Standard_Real NormeD1 = Vec1.Magnitude();
54 Deriv = TheDirection.XY().Crossed(Vec2.XY())/NormeD1-
55 Vec1.XY().Dot(Vec2.XY())*TheDirection.XY().Crossed(Vec1.XY())/NormeD1;
59 Standard_Boolean Geom2dGcc_FunctionTanObl::
60 Values (const Standard_Real X ,
62 Standard_Real& Deriv ) {
66 Geom2dGcc_CurveTool::D2(TheCurv,X,Point,Vec1,Vec2);
67 Standard_Real NormeD1 = Vec1.Magnitude();
68 Fval = TheDirection.XY().Crossed(Vec1.XY())/NormeD1;
69 Deriv = TheDirection.XY().Crossed(Vec2.XY())/NormeD1-
70 Vec1.XY().Dot(Vec2.XY())*TheDirection.XY().Crossed(Vec1.XY())/NormeD1;