Select Git revision
Tetrahedralize.cpp
Forked from
gmsh / gmsh
Source project has a limited visibility.
NumericEmbedded.h 3.43 KiB
#ifndef _NUMERIC_EMBEDDED_H_
#define _NUMERIC_EMBEDDED_H_
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems to <gmsh@geuz.org>.
#include <math.h>
#define Pi 3.1415926535897932
#define Deux_Pi 6.2831853071795865
#if !defined(M_PI)
#define M_PI Pi
#endif
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)<(b))?(b):(a))
#define SQR(a) ((a)*(a))
#define IMIN MIN
#define LMIN MIN
#define FMIN MIN
#define DMIN MIN
#define IMAX MAX
#define LMAX MAX
#define FMAX MAX
#define DMAX MAX
#define DSQR SQR
#define FSQR SQR
#define myhypot(a,b) (sqrt((a)*(a)+(b)*(b)))
#define sign(x) (((x)>=0)?1:-1)
double myatan2(double a, double b);
double myasin(double a);
double myacos(double a);
inline void prodve(double a[3], double b[3], double c[3])
{
c[2] = a[0] * b[1] - a[1] * b[0];
c[1] = -a[0] * b[2] + a[2] * b[0];
c[0] = a[1] * b[2] - a[2] * b[1];
}
inline void prosca(double a[3], double b[3], double *c)
{
*c = a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
}
void matvec(double mat[3][3], double vec[3], double res[3]);
inline double norm3(double a[3])
{
return sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2]);
}
inline double norme(double a[3])