rpp_vecmat.h
Go to the documentation of this file.
1 /* ========================================================================
2  * PROJECT: ARToolKitPlus
3  * ========================================================================
4  * This work is based on the original ARToolKit developed by
5  * Hirokazu Kato
6  * Mark Billinghurst
7  * HITLab, University of Washington, Seattle
8  * http://www.hitl.washington.edu/artoolkit/
9  *
10  * Copyright of the derived and new portions of this work
11  * (C) 2006 Graz University of Technology
12  *
13  * This framework is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 2 of the License, or
16  * (at your option) any later version.
17  *
18  * This framework is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this framework; if not, write to the Free Software
25  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26  *
27  * For further information please contact
28  * Dieter Schmalstieg
29  * <schmalstieg@icg.tu-graz.ac.at>
30  * Graz University of Technology,
31  * Institut for Computer Graphics and Vision,
32  * Inffeldgasse 16a, 8010 Graz, Austria.
33  * ========================================================================
34  ** @author Thomas Pintaric
35  *
36  * $Id: rpp_vecmat.h 162 2006-04-19 21:28:10Z grabner $
37  * @file
38  * ======================================================================== */
39 
40 
41 #ifndef __RPP_VECMAT_H__
42 #define __RPP_VECMAT_H__
43 
44 #include "rpp_const.h"
45 #include "rpp_types.h"
46 
47 namespace rpp {
48 
49 real_t _sin(real_t a);
50 real_t _cos(real_t a);
52 real_t _abs(real_t a);
55 real_t _pow(real_t a);
56 
57 void mat33_from_double_pptr(mat33_t &mat, double** m_ptr);
58 double ** mat33_to_double_pptr(const mat33_t &mat);
59 void free_double_pptr(double*** m_ptr);
60 void vec3_from_double_ptr(vec3_t &vec, double* v_ptr);
61 double* vec3_to_double_ptr(const vec3_t &vec);
62 void free_double_ptr(double** v_ptr);
63 void mat33_assign(mat33_t &m,
64  const real_t m00, const real_t m01, const real_t m02,
65  const real_t m10, const real_t m11, const real_t m12,
66  const real_t m20, const real_t m21, const real_t m22);
67 void _dbg_quat_print(const quat_t &q, char* name);
68 void _dbg_mat33_print(const mat33_t &m, char* name);
69 void _dbg_mat33_array_print(const mat33_array &m, char* name);
70 void _dbg_vec3_print(const vec3_t &v, char* name);
71 void _dbg_vec3_array_print(const vec3_array &v, char* name);
72 bool _dbg_load_vec3_array(vec3_array &va, char* filename);
73 void vec3_assign(vec3_t &v, const real_t x, const real_t y, const real_t z);
74 void vec3_clear(vec3_t &v);
75 void vec3_copy(vec3_t &a, const vec3_t &b);
76 void vec3_array_sum(vec3_t &v_sum2, const vec3_array &va);
77 void vec3_array_sum(scalar_array &v_sum1, const vec3_array &va);
78 void vec3_array_pow2(vec3_array &va);
79 void vec3_div(vec3_t &va, const real_t n);
80 void vec3_div(vec3_t &va, const vec3_t &vb);
81 void vec3_mult(vec3_t &va, const real_t n);
82 void vec3_mult(vec3_t &va, const vec3_t &vb);
83 void vec3_add(vec3_t &va, const real_t f);
84 void vec3_add(vec3_t &va, const vec3_t &vb);
85 void vec3_add(vec3_t &va, const vec3_t &vb, const vec3_t &vc);
86 void vec3_sub(vec3_t &va, const real_t f);
87 void vec3_sub(vec3_t &va, const vec3_t &vb);
88 void vec3_sub(vec3_t &va, const vec3_t &vb, const vec3_t &vc);
89 real_t vec3_dot(const vec3_t &va, const vec3_t &vb);
90 void vec3_cross(vec3_t &va, const vec3_t &vb, const vec3_t &vc);
91 real_t vec3_norm(const vec3_t &v);
92 real_t vec3_sum(const vec3_t &v);
93 void vec3_array_add(vec3_array &va, const vec3_t &a);
94 void vec3_array_sub(vec3_array &va, const vec3_t &a);
95 void vec3_array_set(vec3_array &va, const vec3_t &a, const bool mask[3]);
96 void vec3_array_mult(vec3_array &va, const scalar_array &c);
97 void vec3_array_mean(vec3_t &v_mean, const vec3_array &va);
98 void vec3_mul_vec3trans(mat33_t &m, const vec3_t &va, const vec3_t &vb);
99 real_t vec3trans_mul_vec3(const vec3_t &va, const vec3_t &vb);
100 void mat33_clear(mat33_t &m);
101 void mat33_copy(mat33_t &md, const mat33_t &ms);
102 void mat33_to_col_vec3(vec3_t &c0, vec3_t &c1, vec3_t &c2, const mat33_t &m);
103 void mat33_div(mat33_t &m, const real_t f);
104 void mat33_eye(mat33_t &m);
105 real_t mat33_sum(const mat33_t &m);
106 bool mat33_all_zeros(const mat33_t &m);
107 void mat33_set_all_zeros(mat33_t &m);
108 void mat33_array_sum(mat33_t &s, const mat33_array &ma);
109 void mat33_sub(mat33_t &mr, const mat33_t &ma, const mat33_t &mb);
110 void mat33_sub(mat33_t &ma, const mat33_t &mb);
111 void mat33_add(mat33_t &mr, const mat33_t &ma, const mat33_t &mb);
112 void mat33_add(mat33_t &ma, const mat33_t &mb);
113 real_t mat33_det(const mat33_t &a);
114 void mat33_inv(mat33_t &mi, const mat33_t &ma);
115 void mat33_mult(mat33_t &m0, const mat33_t &m1, const mat33_t &m2);
116 void mat33_mult(mat33_t &mr, const real_t n);
117 void mat33_transpose(mat33_t &t, const mat33_t m);
118 void vec3_mult(vec3_t &v0, const mat33_t &m1, const vec3_t &v2);
119 void vec3_array_mult(vec3_array &va, const mat33_t &m, const vec3_array &vb);
120 void mat33_svd2(mat33_t &u, mat33_t &s, mat33_t &v, const mat33_t &m);
121 void quat_mult(quat_t &q, const real_t s);
122 real_t quat_norm(const quat_t &q);
123 void mat33_from_quat(mat33_t &m, const quat_t &q);
124 void normRv(vec3_t &n, const vec3_t &v);
125 void normRv(vec3_array &normR_v, const vec3_array &v);
126 
127 int solve_polynomial(scalar_array &sol, const scalar_array &coefficients);
128 void scalar_array_pow(scalar_array &sa, const real_t f);
131  const real_t f,
132  const unsigned int sz);
133 void scalar_array_add(scalar_array &sa, const scalar_array &sb);
136  const scalar_array &sb,
137  const scalar_array &sc);
138 
139 void _dbg_scalar_array_print(const scalar_array &sa, char* name);
141 void scalar_array_div(scalar_array &sa, const scalar_array &sb);
145 void mat33_pow2(mat33_t &m);
146 
147 void _dbg_vec3_fprint(void* fp, const vec3_t &v, char* name);
148 void _dbg_mat33_fprint(void* fp, const mat33_t &m, char* name);
149 
150 } // namespace rpp
151 
152 #endif
real_t vec3trans_mul_vec3(const vec3_t &va, const vec3_t &vb)
Definition: rpp_vecmat.cpp:511
void scalar_array_clear(scalar_array &sa)
Definition: rpp_vecmat.cpp:872
void mat33_eye(mat33_t &m)
Definition: rpp_vecmat.cpp:560
real_t mat33_det(const mat33_t &a)
Definition: rpp_vecmat.cpp:658
real_t _sin(real_t a)
Definition: rpp_vecmat.cpp:69
void mat33_svd2(mat33_t &u, mat33_t &s, mat33_t &v, const mat33_t &m)
Definition: rpp_vecmat.cpp:730
void _dbg_mat33_print(const mat33_t &m, char *name)
Definition: rpp_vecmat.cpp:206
void mat33_to_col_vec3(vec3_t &c0, vec3_t &c1, vec3_t &c2, const mat33_t &m)
Definition: rpp_vecmat.cpp:536
void normRv(vec3_t &n, const vec3_t &v)
Definition: rpp_vecmat.cpp:792
void mat33_div(mat33_t &m, const real_t f)
Definition: rpp_vecmat.cpp:547
bool _dbg_load_vec3_array(vec3_array &va, char *filename)
Definition: rpp_vecmat.cpp:265
void vec3_array_sub(vec3_array &va, const vec3_t &a)
Definition: rpp_vecmat.cpp:457
void mat33_mult(mat33_t &m0, const mat33_t &m1, const mat33_t &m2)
Definition: rpp_vecmat.cpp:682
Definition: rpp.cpp:55
std::vector< mat33_t > mat33_array
Definition: rpp_types.h:77
void scalar_array_negate(scalar_array &sa)
Definition: rpp_vecmat.cpp:850
real_t vec3_dot(const vec3_t &va, const vec3_t &vb)
Definition: rpp_vecmat.cpp:424
void scalar_array_mult(scalar_array &sa, real_t f)
Definition: rpp_vecmat.cpp:909
void free_double_ptr(double **v_ptr)
Definition: rpp_vecmat.cpp:172
void vec3_from_double_ptr(vec3_t &vec, double *v_ptr)
Definition: rpp_vecmat.cpp:139
bool mat33_all_zeros(const mat33_t &m)
Definition: rpp_vecmat.cpp:585
void free_double_pptr(double ***m_ptr)
Definition: rpp_vecmat.cpp:127
std::vector< vec3_t > vec3_array
Definition: rpp_types.h:71
void quat_mult(quat_t &q, const real_t s)
Definition: rpp_vecmat.cpp:758
void _dbg_vec3_fprint(void *fp, const vec3_t &v, char *name)
Definition: rpp_vecmat.cpp:943
void vec3_array_pow2(vec3_array &va)
Definition: rpp_vecmat.cpp:340
double * vec3_to_double_ptr(const vec3_t &vec)
Definition: rpp_vecmat.cpp:153
void mat33_clear(mat33_t &m)
Definition: rpp_vecmat.cpp:517
double ** mat33_to_double_pptr(const mat33_t &mat)
Definition: rpp_vecmat.cpp:105
void vec3_cross(vec3_t &va, const vec3_t &vb, const vec3_t &vc)
Definition: rpp_vecmat.cpp:429
void _dbg_mat33_array_print(const mat33_array &m, char *name)
Definition: rpp_vecmat.cpp:221
void mat33_assign(mat33_t &m, const real_t m00, const real_t m01, const real_t m02, const real_t m10, const real_t m11, const real_t m12, const real_t m20, const real_t m21, const real_t m22)
Definition: rpp_vecmat.cpp:184
real_t _cos(real_t a)
Definition: rpp_vecmat.cpp:70
void mat33_from_double_pptr(mat33_t &mat, double **m_ptr)
Definition: rpp_vecmat.cpp:89
void vec3_array_mult(vec3_array &va, const scalar_array &c)
Definition: rpp_vecmat.cpp:479
std::vector< real_t > scalar_array
Definition: rpp_types.h:81
real_t _pow(real_t a, real_t b)
Definition: rpp_vecmat.cpp:75
void _dbg_scalar_array_print(const scalar_array &sa, char *name)
Definition: rpp_vecmat.cpp:888
void scalar_array_atan2(scalar_array &sa, const scalar_array &sb, const scalar_array &sc)
Definition: rpp_vecmat.cpp:877
void mat33_from_quat(mat33_t &m, const quat_t &q)
Definition: rpp_vecmat.cpp:771
void scalar_array_add(scalar_array &sa, const scalar_array &sb)
Definition: rpp_vecmat.cpp:865
void mat33_sub(mat33_t &mr, const mat33_t &ma, const mat33_t &mb)
Definition: rpp_vecmat.cpp:621
void _dbg_vec3_print(const vec3_t &v, char *name)
Definition: rpp_vecmat.cpp:239
real_t vec3_norm(const vec3_t &v)
Definition: rpp_vecmat.cpp:436
real_t _sqrt(real_t a)
Definition: rpp_vecmat.cpp:74
void scalar_array_assign(scalar_array &sa, const real_t f, const unsigned int sz)
Definition: rpp_vecmat.cpp:855
void mat33_set_all_zeros(mat33_t &m)
Definition: rpp_vecmat.cpp:595
void vec3_array_add(vec3_array &va, const vec3_t &a)
Definition: rpp_vecmat.cpp:446
double real_t
Definition: rpp_types.h:64
real_t vec3_sum(const vec3_t &v)
Definition: rpp_vecmat.cpp:441
void vec3_add(vec3_t &va, const real_t f)
Definition: rpp_vecmat.cpp:382
void mat33_inv(mat33_t &mi, const mat33_t &ma)
Definition: rpp_vecmat.cpp:666
int solve_polynomial(scalar_array &r_sol, const scalar_array &coefficients)
Definition: rpp_vecmat.cpp:821
void scalar_array_pow(scalar_array &sa, const real_t f)
Definition: rpp_vecmat.cpp:845
void mat33_array_sum(mat33_t &s, const mat33_array &ma)
Definition: rpp_vecmat.cpp:605
real_t quat_norm(const quat_t &q)
Definition: rpp_vecmat.cpp:764
void vec3_mul_vec3trans(mat33_t &m, const vec3_t &va, const vec3_t &vb)
Definition: rpp_vecmat.cpp:498
void vec3_array_mean(vec3_t &v_mean, const vec3_array &va)
Definition: rpp_vecmat.cpp:490
void vec3_clear(vec3_t &v)
Definition: rpp_vecmat.cpp:304
real_t _abs(real_t a)
Definition: rpp_vecmat.cpp:72
void vec3_sub(vec3_t &va, const real_t f)
Definition: rpp_vecmat.cpp:403
void vec3_array_sum(vec3_t &v_sum2, const vec3_array &va)
Definition: rpp_vecmat.cpp:319
void scalar_array_sub(scalar_array &sa, real_t f)
Definition: rpp_vecmat.cpp:925
void mat33_copy(mat33_t &md, const mat33_t &ms)
Definition: rpp_vecmat.cpp:526
void _dbg_quat_print(const quat_t &q, char *name)
Definition: rpp_vecmat.cpp:195
void _dbg_vec3_array_print(const vec3_array &v, char *name)
Definition: rpp_vecmat.cpp:250
void vec3_div(vec3_t &va, const real_t n)
Definition: rpp_vecmat.cpp:354
void mat33_pow2(mat33_t &m)
Definition: rpp_vecmat.cpp:933
real_t _atan2(real_t a, real_t b)
Definition: rpp_vecmat.cpp:71
void mat33_transpose(mat33_t &t, const mat33_t m)
Definition: rpp_vecmat.cpp:704
ARFloat mat[3][4]
void _dbg_mat33_fprint(void *fp, const mat33_t &m, char *name)
Definition: rpp_vecmat.cpp:953
void mat33_add(mat33_t &mr, const mat33_t &ma, const mat33_t &mb)
Definition: rpp_vecmat.cpp:639
real_t mat33_sum(const mat33_t &m)
Definition: rpp_vecmat.cpp:573
void vec3_array_set(vec3_array &va, const vec3_t &a, const bool mask[3])
Definition: rpp_vecmat.cpp:468
void vec3_copy(vec3_t &a, const vec3_t &b)
Definition: rpp_vecmat.cpp:311
void scalar_array_div(scalar_array &sa, real_t f)
Definition: rpp_vecmat.cpp:894
real_t _acos(real_t a)
Definition: rpp_vecmat.cpp:73
void vec3_assign(vec3_t &v, const real_t x, const real_t y, const real_t z)
Definition: rpp_vecmat.cpp:297
void vec3_mult(vec3_t &va, const real_t n)
Definition: rpp_vecmat.cpp:368


tuw_artoolkitplus
Author(s): Markus Bader
autogenerated on Sun Sep 4 2016 03:24:33