1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
/****************************************************************************
Copyright (C) 2012 HidraVFX development team
<https://launchpad.net/~hidravfx-dev-team>
This file is part of the HidraVFX project.
HidraVFX 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 3 of the License, or
(at your option) any later version.
HidraVFX 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 HidraVFX. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#ifndef VERTEX_H_
#define VERTEX_H_
/* native point object */
typedef struct
{
double x;
double y;
double z;
} tpoint;
typedef struct
{
double x;
double y;
double z;
} tvertex;
extern void tpoint_swap(tpoint *a, tpoint *b);
extern tpoint tpoint_2d(double xi,double yi);
extern tpoint tpoint_3d(double xi,double yi,double zi);
extern tpoint tpoint_copy(tpoint *a);
extern tvertex tvertex_2d(double x0,double y0);
extern tvertex tvertex_3d(double x0,double y0,double z0);
extern tvertex tvertex_copy(tvertex *a);
extern tvertex tvertex_null(void);
extern tvertex tvertex_sub(tvertex *v1, tvertex *v2);
extern tvertex tvertex_add(tvertex *v1, tvertex *v2);
extern tvertex tvertex_mul(tvertex *v1, tvertex *v2);
extern double tvertex_length(tvertex *v);
#endif
|