Integration of OCCT 6.5.0 from SVN
[occt.git] / src / Bisector / Bisector.cxx
CommitLineData
7fd59977 1// File: Bisector.cxx
2// Created: Tue mar 3 17:54:52 1994
3// Author: Yves FRICAUD
4// <yfr@phylox>
5
6
7#include <Bisector.ixx>
8#include <gp_Pnt2d.hxx>
9#include <gp_Vec2d.hxx>
10
11//======================================================================
12// function : IsConvex
13// Purpose :
14//======================================================================
15Standard_Boolean Bisector::IsConvex(const Handle(Geom2d_Curve)& Cu,
16 const Standard_Real Sign)
17{
18
19 Standard_Real U1 = (Cu->LastParameter() + Cu->FirstParameter())/2.;
20 gp_Pnt2d P1;
21 gp_Vec2d V1,V2;
22 Cu->D2(U1,P1,V1,V2);
23 Standard_Real Tol = 1.e-5;
24 if (Sign*(V1^V2) < Tol) return Standard_True; // <= 0.
25 else return Standard_False;
26}
27