Warnings on vc14 were eliminated
[occt.git] / src / Geom2dGcc / Geom2dGcc_FunctionTanObl.cxx
CommitLineData
54e37688 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
5//
6// This file is part of Open CASCADE Technology software library.
7//
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.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
54e37688 17
18#include <Geom2dAdaptor_Curve.hxx>
19#include <Geom2dGcc_CurveTool.hxx>
42cf5bc1 20#include <Geom2dGcc_FunctionTanObl.hxx>
21#include <gp_Dir2d.hxx>
22#include <gp_Pnt2d.hxx>
23#include <gp_Vec2d.hxx>
54e37688 24
25Geom2dGcc_FunctionTanObl::
26Geom2dGcc_FunctionTanObl(const Geom2dAdaptor_Curve& C,
27 const gp_Dir2d& Dir )
28{
29 TheCurv = C;
30 TheDirection = Dir;
31}
32
33
34Standard_Boolean Geom2dGcc_FunctionTanObl::
35Value (const Standard_Real X,
36 Standard_Real& Fval ) {
37 gp_Pnt2d Point;
38 gp_Vec2d Vect;
39 Geom2dGcc_CurveTool::D1(TheCurv,X,Point,Vect);
40 Standard_Real NormeD1 = Vect.Magnitude();
41 Fval = TheDirection.XY().Crossed(Vect.XY())/NormeD1;
42 return Standard_True;
43}
44
45Standard_Boolean Geom2dGcc_FunctionTanObl::
46Derivative (const Standard_Real X,
47 Standard_Real& Deriv )
48{
49 gp_Pnt2d Point;
50 gp_Vec2d Vec1;
51 gp_Vec2d Vec2;
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;
56 return Standard_True;
57}
58
59Standard_Boolean Geom2dGcc_FunctionTanObl::
60Values (const Standard_Real X ,
61 Standard_Real& Fval ,
62 Standard_Real& Deriv ) {
63 gp_Pnt2d Point;
64 gp_Vec2d Vec1;
65 gp_Vec2d Vec2;
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;
71 return Standard_True;
72}
73