BRL-CAD
bn_mat.c
Go to the documentation of this file.
1 /* B N _ M A T . C
2  * BRL-CAD
3  *
4  * Copyright (c) 2013-2014 United States Government as represented by
5  * the U.S. Army Research Laboratory.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License
9  * version 2.1 as published by the Free Software Foundation.
10  *
11  * This library is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this file; see the file named COPYING for more
18  * information.
19  */
20 
21 #include "common.h"
22 
23 #include <math.h>
24 #include <string.h>
25 #include "bio.h"
26 
27 #include "vmath.h"
28 #include "bu/log.h"
29 #include "bn.h"
30 
31 static int
32 mat_equal(const mat_t a, const mat_t b)
33 {
34  int i;
35  for (i = 0; i < 16; i++) {
36  if (!NEAR_EQUAL(a[i], b[i], BN_TOL_DIST)) return 0;
37  }
38  return 1;
39 }
40 
41 static void
42 scan_mat_args(char *argv[], int argnum, mat_t *mat)
43 {
44  sscanf(argv[argnum], "%lg,%lg,%lg,%lg,%lg,%lg,%lg,%lg,%lg,%lg,%lg,%lg,%lg,%lg,%lg,%lg", &(*mat)[0], &(*mat)[1], &(*mat)[2], &(*mat)[3], &(*mat)[4], &(*mat)[5], &(*mat)[6], &(*mat)[7], &(*mat)[8], &(*mat)[9], &(*mat)[10], &(*mat)[11], &(*mat)[12], &(*mat)[13], &(*mat)[14], &(*mat)[15]);
45 }
46 
47 static int
48 test_bn_mat_mul(int argc, char *argv[])
49 {
50  mat_t m1, m2, expected, actual;
51 
52  if (argc != 5) {
53  bu_exit(1, "<args> format: M1 M2 <expected_result> [%s]\n", argv[0]);
54  }
55 
56  scan_mat_args(argv, 2, &m1);
57  scan_mat_args(argv, 3, &m2);
58  scan_mat_args(argv, 4, &expected);
59 
60  bn_mat_mul(actual, m1, m2);
61  return !mat_equal(expected, actual);
62 }
63 
64 static int
65 test_bn_mat_mul3(int argc, char *argv[])
66 {
67  mat_t m1, m2, m3, expected, actual;
68 
69  if (argc != 6) {
70  bu_exit(1, "<args> format: M1 M2 M3 <expected_result> [%s]\n", argv[0]);
71  }
72 
73  scan_mat_args(argv, 2, &m1);
74  scan_mat_args(argv, 3, &m2);
75  scan_mat_args(argv, 4, &m3);
76  scan_mat_args(argv, 5, &expected);
77 
78  bn_mat_mul3(actual, m1, m2, m3);
79  return !mat_equal(expected, actual);
80 }
81 
82 static int
83 test_bn_mat_mul4(int argc, char *argv[])
84 {
85  mat_t m1, m2, m3, m4, expected, actual;
86 
87  if (argc != 7) {
88  bu_exit(1, "<args> format: M1 M2 M3 M4 <expected_result> [%s]\n", argv[0]);
89  }
90 
91  scan_mat_args(argv, 2, &m1);
92  scan_mat_args(argv, 3, &m2);
93  scan_mat_args(argv, 4, &m3);
94  scan_mat_args(argv, 5, &m4);
95  scan_mat_args(argv, 6, &expected);
96 
97  bn_mat_mul4(actual, m1, m2, m3, m4);
98  return !mat_equal(expected, actual);
99 }
100 
101 static int
102 test_bn_matXvec(int argc, char *argv[])
103 {
104  mat_t m;
105  hvect_t v, expected, actual;
106 
107  if (argc != 5) {
108  bu_exit(1, "<args> format: M V <expected_result> [%s]\n", argv[0]);
109  }
110 
111  scan_mat_args(argv, 2, &m);
112  sscanf(argv[3], "%lg,%lg,%lg,%lg", &v[0], &v[1], &v[2], &v[3]);
113  sscanf(argv[4], "%lg,%lg,%lg,%lg", &expected[0], &expected[1], &expected[2], &expected[3]);
114 
115  bn_matXvec(actual, m, v);
116  return !HNEAR_EQUAL(expected, actual, BN_TOL_DIST);
117 }
118 
119 static int
120 test_bn_mat_inverse(int argc, char *argv[])
121 {
122  mat_t m, expected, actual;
123  int singular;
124 
125  sscanf(argv[2], "%d", &singular);
126  if ((argc == 4 && !singular) || (argc != 4 && argc != 5)) {
127  bu_exit(1, "<args> format: 0|1 M [expected_result] [%s]\n", argv[0]);
128  }
129 
130  scan_mat_args(argv, 3, &m);
131  if (!singular) {
132  scan_mat_args(argv, 4, &expected);
133  }
134 
135  if (!bn_mat_inverse(actual, m)) {
136  return !singular;
137  }
138 
139  return !mat_equal(expected, actual);
140 }
141 
142 static int
143 test_bn_mat_trn(int argc, char *argv[])
144 {
145  mat_t m, expected, actual;
146 
147  if (argc != 4) {
148  bu_exit(1, "<args> format: M <expected_result> [%s]\n", argv[0]);
149  }
150 
151  scan_mat_args(argv, 2, &m);
152  scan_mat_args(argv, 3, &expected);
153 
154  bn_mat_trn(actual, m);
155  return !mat_equal(expected, actual);
156 }
157 
158 static int
159 test_bn_mat_is_identity(int argc, char *argv[])
160 {
161  mat_t m;
162  int expected;
163 
164  if (argc != 4) {
165  bu_exit(1, "<args> format: M <expected_result> [%s]\n", argv[0]);
166  }
167 
168  scan_mat_args(argv, 2, &m);
169  sscanf(argv[3], "%d", &expected);
170 
171  return !(bn_mat_is_identity(m) == expected);
172 }
173 
174 static int
175 test_bn_mat_det3(int argc, char *argv[])
176 {
177  mat_t m;
178  fastf_t expected, actual;
179 
180  if (argc != 4) {
181  bu_exit(1, "<args> format: M <expected_result> [%s]\n", argv[0]);
182  }
183 
184  scan_mat_args(argv, 2, &m);
185  sscanf(argv[3], "%lg", &expected);
186 
187  actual = bn_mat_det3(m);
188  return !NEAR_EQUAL(expected, actual, BN_TOL_DIST);
189 }
190 
191 static int
192 test_bn_mat_determinant(int argc, char *argv[])
193 {
194  mat_t m = MAT_INIT_ZERO;
195  fastf_t expected = 0.0, actual = 0.0;
196 
197  if (argc != 4) {
198  bu_exit(1, "<args> format: M <expected_result> [%s]\n", argv[0]);
199  }
200 
201  scan_mat_args(argv, 2, &m);
202  sscanf(argv[3], "%lg", &expected);
203 
204  actual = bn_mat_determinant(m);
205  return !NEAR_EQUAL(expected, actual, BN_TOL_DIST);
206 }
207 
208 static int
209 test_bn_mat_is_equal(int argc, char *argv[])
210 {
211  mat_t m1, m2;
212  int expected;
213  struct bn_tol tol = BN_TOL_INIT_ZERO;
214  tol.dist = BN_TOL_DIST;
215  tol.dist = BN_TOL_DIST * BN_TOL_DIST;
216  tol.perp = BN_TOL_DIST;
217 
218  if (argc != 5) {
219  bu_exit(1, "<args> format: M1 M2 <expected_result> [%s]\n", argv[0]);
220  }
221 
222  scan_mat_args(argv, 2, &m1);
223  scan_mat_args(argv, 3, &m2);
224  sscanf(argv[4], "%d", &expected);
225 
226  return !(bn_mat_is_equal(m1, m2, &tol) == expected);
227 }
228 
229 static int
230 test_bn_atan2(int argc, char *argv[])
231 {
232  double x, y, expected, actual;
233 
234  if (argc != 5) {
235  bu_exit(1, "<args> format: X Y <expected_result> [%s]\n", argv[0]);
236  }
237 
238  sscanf(argv[2], "%lg", &y);
239  sscanf(argv[3], "%lg", &x);
240  sscanf(argv[4], "%lg", &expected);
241 
242  actual = bn_atan2(y, x);
243  return !NEAR_EQUAL(expected, actual, 0.00001);
244 }
245 
246 static int
247 test_bn_vtoh_move(int argc, char *argv[])
248 {
249  hvect_t expected, actual;
250  vect_t v;
251 
252  if (argc != 4) {
253  bu_exit(1, "<args> format: V <expected_result> [%s]\n", argv[0]);
254  }
255 
256  sscanf(argv[2], "%lg,%lg,%lg", &v[0], &v[1], &v[2]);
257  sscanf(argv[3], "%lg,%lg,%lg,%lg", &expected[0], &expected[1], &expected[2], &expected[3]);
258 
259  bn_vtoh_move(actual, v);
260  return !HNEAR_EQUAL(expected, actual, BN_TOL_DIST);
261 }
262 
263 static int
264 test_bn_htov_move(int argc, char *argv[])
265 {
266  hvect_t h;
267  vect_t expected, actual;
268 
269  if (argc != 4) {
270  bu_exit(1, "<args> format: H <expected_result> [%s]\n", argv[0]);
271  }
272 
273  sscanf(argv[2], "%lg,%lg,%lg,%lg", &h[0], &h[1], &h[2], &h[3]);
274  sscanf(argv[3], "%lg,%lg,%lg", &expected[0], &expected[1], &expected[2]);
275 
276  bn_htov_move(actual, h);
277  return !VNEAR_EQUAL(expected, actual, BN_TOL_DIST);
278 }
279 
280 static int
281 test_bn_mat_ae(int argc, char *argv[])
282 {
283  double az, el;
284  mat_t expected, actual;
285 
286  if (argc != 5) {
287  bu_exit(1, "<args> format: az el <expected_result> [%s]\n", argv[0]);
288  }
289 
290  sscanf(argv[2], "%lg", &az);
291  sscanf(argv[3], "%lg", &el);
292  scan_mat_args(argv, 4, &expected);
293 
294  bn_mat_ae(actual, az, el);
295  return !mat_equal(expected, actual);
296 }
297 
298 static int
299 test_bn_ae_vec(int argc, char *argv[])
300 {
301  fastf_t expected_az, expected_el, actual_az, actual_el;
302  vect_t v;
303 
304  if (argc != 5) {
305  bu_exit(1, "<args> format: V <expected_az> <expected_el> [%s]\n", argv[0]);
306  }
307 
308  sscanf(argv[2], "%lg,%lg,%lg", &v[0], &v[1], &v[2]);
309  sscanf(argv[3], "%lg", &expected_az);
310  sscanf(argv[4], "%lg", &expected_el);
311 
312  bn_ae_vec(&actual_az, &actual_el, v);
313  return !(NEAR_EQUAL(expected_az, actual_az, BN_TOL_DIST) && NEAR_EQUAL(expected_el, actual_el, BN_TOL_DIST));
314 }
315 
316 static int
317 test_bn_vec_ae(int argc, char *argv[])
318 {
319  vect_t expected, actual;
320  fastf_t az, el;
321 
322  if (argc != 5) {
323  bu_exit(1, "<args> format: az el <expected_result> [%s]\n", argv[0]);
324  }
325 
326  sscanf(argv[2], "%lg", &az);
327  sscanf(argv[3], "%lg", &el);
328  sscanf(argv[4], "%lg,%lg,%lg", &expected[0], &expected[1], &expected[2]);
329 
330  bn_vec_ae(actual, az, el);
331  return !VNEAR_EQUAL(expected, actual, BN_TOL_DIST);
332 }
333 
334 static int
335 test_bn_vec_aed(int argc, char *argv[])
336 {
337  vect_t expected, actual;
338  fastf_t az, el, d;
339 
340  if (argc != 6) {
341  bu_exit(1, "<args> format: az el d <expected_result> [%s]\n", argv[0]);
342  }
343 
344  sscanf(argv[2], "%lg", &az);
345  sscanf(argv[3], "%lg", &el);
346  sscanf(argv[4], "%lg", &d);
347  sscanf(argv[5], "%lg,%lg,%lg", &expected[0], &expected[1], &expected[2]);
348 
349  bn_vec_aed(actual, az, el, d);
350  return !VNEAR_EQUAL(expected, actual, BN_TOL_DIST);
351 }
352 
353 static int
354 test_bn_mat_angles(int argc, char *argv[])
355 {
356  mat_t expected, actual;
357  double x, y, z;
358 
359  if (argc != 6) {
360  bu_exit(1, "<args> format: x y z <expected_result> [%s]\n", argv[0]);
361  }
362 
363  sscanf(argv[2], "%lg", &x);
364  sscanf(argv[3], "%lg", &y);
365  sscanf(argv[4], "%lg", &z);
366  scan_mat_args(argv, 5, &expected);
367 
368  bn_mat_angles(actual, x, y, z);
369  return !mat_equal(expected, actual);
370 }
371 
372 static int
373 test_bn_mat_angles_rad(int argc, char *argv[])
374 {
375  mat_t expected, actual;
376  double x, y, z;
377 
378  if (argc != 6) {
379  bu_exit(1, "<args> format: x y z <expected_result> [%s]\n", argv[0]);
380  }
381 
382  sscanf(argv[2], "%lg", &x);
383  sscanf(argv[3], "%lg", &y);
384  sscanf(argv[4], "%lg", &z);
385  scan_mat_args(argv, 5, &expected);
386 
387  bn_mat_angles_rad(actual, x, y, z);
388  return !mat_equal(expected, actual);
389 }
390 
391 static int
392 test_bn_eigen2x2(int argc, char *argv[])
393 {
394  fastf_t expected_val1, expected_val2, actual_val1, actual_val2;
395  fastf_t a, b, c;
396  vect_t expected_vec1, expected_vec2, actual_vec1, actual_vec2;
397 
398  if (argc != 9) {
399  bu_exit(1, "<args> format: a b c <expected_val1> <expected_val2> <expected_vec1> <expected_vec2> [%s]\n", argv[0]);
400  }
401 
402  sscanf(argv[2], "%lg", &a);
403  sscanf(argv[3], "%lg", &b);
404  sscanf(argv[4], "%lg", &c);
405  sscanf(argv[5], "%lg", &expected_val1);
406  sscanf(argv[6], "%lg", &expected_val2);
407  sscanf(argv[7], "%lg,%lg,%lg", &expected_vec1[0], &expected_vec1[1], &expected_vec1[2]);
408  sscanf(argv[8], "%lg,%lg,%lg", &expected_vec2[0], &expected_vec2[1], &expected_vec2[2]);
409 
410  bn_eigen2x2(&actual_val1, &actual_val2, actual_vec1, actual_vec2, a, b, c);
411  return !(VNEAR_EQUAL(expected_vec1, actual_vec1, BN_TOL_DIST) && VNEAR_EQUAL(expected_vec2, actual_vec2, BN_TOL_DIST) && NEAR_EQUAL(expected_val1, actual_val1, BN_TOL_DIST) && NEAR_EQUAL(expected_val2, actual_val2, BN_TOL_DIST));
412 }
413 
414 static int
415 test_bn_mat_xrot(int argc, char *argv[])
416 {
417  mat_t expected, actual;
418  double sinx, cosx;
419 
420  if (argc != 5) {
421  bu_exit(1, "<args> format: sinx cosx <expected_result> [%s]\n", argv[0]);
422  }
423 
424  sscanf(argv[2], "%lg", &sinx);
425  sscanf(argv[3], "%lg", &cosx);
426  scan_mat_args(argv, 4, &expected);
427 
428  bn_mat_xrot(actual, sinx, cosx);
429  return !mat_equal(expected, actual);
430 }
431 
432 static int
433 test_bn_mat_yrot(int argc, char *argv[])
434 {
435  mat_t expected, actual;
436  double siny, cosy;
437 
438  if (argc != 5) {
439  bu_exit(1, "<args> format: siny cosy <expected_result> [%s]\n", argv[0]);
440  }
441 
442  sscanf(argv[2], "%lg", &siny);
443  sscanf(argv[3], "%lg", &cosy);
444  scan_mat_args(argv, 4, &expected);
445 
446  bn_mat_yrot(actual, siny, cosy);
447  return !mat_equal(expected, actual);
448 }
449 
450 static int
451 test_bn_mat_zrot(int argc, char *argv[])
452 {
453  mat_t expected, actual;
454  double sinz, cosz;
455 
456  if (argc != 5) {
457  bu_exit(1, "<args> format: sinz cosz <expected_result> [%s]\n", argv[0]);
458  }
459 
460  sscanf(argv[2], "%lg", &sinz);
461  sscanf(argv[3], "%lg", &cosz);
462  scan_mat_args(argv, 4, &expected);
463 
464  bn_mat_zrot(actual, sinz, cosz);
465  return !mat_equal(expected, actual);
466 }
467 
468 static int
469 test_bn_mat_scale_about_pt(int argc, char *argv[])
470 {
471  mat_t expected, actual;
472  point_t p;
473  double s;
474  int error, expected_error;
475 
476  if (argc != 6) {
477  bu_exit(1, "<args> format: P s error <expected_result> [%s]\n", argv[0]);
478  }
479 
480  sscanf(argv[2], "%lg,%lg,%lg", &p[0], &p[1], &p[2]);
481  sscanf(argv[3], "%lg", &s);
482  sscanf(argv[4], "%d", &expected_error);
483  scan_mat_args(argv, 5, &expected);
484 
485  error = bn_mat_scale_about_pt(actual, p, s);
486  return !(mat_equal(expected, actual) && error == expected_error);
487 }
488 
489 static int
490 test_bn_mat_xform_about_pt(int argc, char *argv[])
491 {
492  mat_t xform, expected, actual;
493  point_t p;
494 
495  if (argc != 5) {
496  bu_exit(1, "<args> format: M P <expected_result> [%s]\n", argv[0]);
497  }
498 
499  scan_mat_args(argv, 2, &xform);
500  sscanf(argv[3], "%lg,%lg,%lg", &p[0], &p[1], &p[2]);
501  scan_mat_args(argv, 4, &expected);
502 
503  bn_mat_xform_about_pt(actual, xform, p);
504  return !mat_equal(expected, actual);
505 }
506 
507 static int
508 test_bn_mat_ck(int argc, char *argv[])
509 {
510  mat_t m;
511  int expected;
512  char *title = "test_bn_mat_ck";
513 
514  if (argc != 4) {
515  bu_exit(1, "<args> format: M <expected_result> [%s]\n", argv[0]);
516  }
517 
518  scan_mat_args(argv, 2, &m);
519  sscanf(argv[3], "%d", &expected);
520 
521  return !(bn_mat_ck(title, m) == expected);
522 }
523 
524 static int
525 test_bn_mat_dup(void)
526 {
527  mat_t m = {1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9, 10.1, 11.11, 12.12, 13.13, 14.14, 15.15, 16.16};
528  matp_t expected = m, actual;
529 
530  actual = bn_mat_dup(m);
531  return !mat_equal(expected, actual);
532 }
533 
534 int
535 main(int argc, char *argv[])
536 {
537  int function_num = 0;
538 
539  if (argc < 3) {
540  bu_exit(1, "Argument format: <function_number> <args> [%s]\n", argv[0]);
541  }
542 
543  sscanf(argv[1], "%d", &function_num);
544  if (function_num < 1 || function_num > 27) function_num = 0;
545 
546  switch (function_num) {
547  case 1:
548  return test_bn_mat_mul(argc, argv);
549  case 2:
550  return test_bn_mat_mul3(argc, argv);
551  case 3:
552  return test_bn_mat_mul4(argc, argv);
553  case 4:
554  return test_bn_matXvec(argc, argv);
555  case 5:
556  return test_bn_mat_inverse(argc, argv);
557  case 6:
558  return test_bn_mat_trn(argc, argv);
559  case 7:
560  return test_bn_mat_is_identity(argc, argv);
561  case 8:
562  return test_bn_mat_det3(argc, argv);
563  case 9:
564  return test_bn_mat_determinant(argc, argv);
565  case 10:
566  return test_bn_mat_is_equal(argc, argv);
567  case 11:
568  return test_bn_atan2(argc, argv);
569  case 12:
570  return test_bn_vtoh_move(argc, argv);
571  case 13:
572  return test_bn_htov_move(argc, argv);
573  case 14:
574  return test_bn_mat_ae(argc, argv);
575  case 15:
576  return test_bn_ae_vec(argc, argv);
577  case 16:
578  return test_bn_vec_ae(argc, argv);
579  case 17:
580  return test_bn_vec_aed(argc, argv);
581  case 18:
582  return test_bn_mat_angles(argc, argv);
583  case 19:
584  return test_bn_mat_angles_rad(argc, argv);
585  case 20:
586  return test_bn_eigen2x2(argc, argv);
587  case 21:
588  return test_bn_mat_xrot(argc, argv);
589  case 22:
590  return test_bn_mat_yrot(argc, argv);
591  case 23:
592  return test_bn_mat_zrot(argc, argv);
593  case 24:
594  return test_bn_mat_scale_about_pt(argc, argv);
595  case 25:
596  return test_bn_mat_xform_about_pt(argc, argv);
597  case 26:
598  return test_bn_mat_ck(argc, argv);
599  case 27:
600  return test_bn_mat_dup();
601  }
602 
603  bu_log("ERROR: function_num %d is not valid [%s]\n", function_num, argv[0]);
604  return 1;
605 }
606 
607 /*
608  * Local Variables:
609  * mode: C
610  * tab-width: 8
611  * indent-tabs-mode: t
612  * c-file-style: "stroustrup"
613  * End:
614  * ex: shiftwidth=4 tabstop=8
615  */
void bn_ae_vec(fastf_t *azp, fastf_t *elp, const vect_t v)
Definition: mat.c:374
void bn_mat_ae(mat_t m, double azimuth, double elev)
int main(int argc, char *argv[])
Definition: bn_mat.c:535
void bu_log(const char *,...) _BU_ATTR_PRINTF12
Definition: log.c:176
int bn_mat_is_identity(const mat_t m)
Definition: mat.c:980
fastf_t bn_mat_determinant(const mat_t m)
Definition: mat.c:1117
#define BN_TOL_INIT_ZERO
Definition: tol.h:99
double dist
>= 0
Definition: tol.h:73
if lu s
Definition: nmg_mod.c:3860
void bn_htov_move(vect_t v, const vect_t h)
void bn_mat_xrot(mat_t m, double sinx, double cosx)
Header file for the BRL-CAD common definitions.
int bn_mat_inverse(mat_t output, const mat_t input)
void bn_eigen2x2(fastf_t *val1, fastf_t *val2, vect_t vec1, vect_t vec2, fastf_t a, fastf_t b, fastf_t c)
void bn_mat_mul4(mat_t o, const mat_t a, const mat_t b, const mat_t c, const mat_t d)
Definition: mat.c:166
fastf_t bn_mat_det3(const mat_t m)
Definition: mat.c:1104
int bn_mat_is_equal(const mat_t a, const mat_t b, const struct bn_tol *tol)
Definition: mat.c:925
void bu_exit(int status, const char *fmt,...) _BU_ATTR_NORETURN _BU_ATTR_PRINTF23
Definition: bomb.c:195
int bn_mat_scale_about_pt(mat_t mat, const point_t pt, const double scale)
Definition: mat.c:884
void bn_matXvec(hvect_t ov, const mat_t im, const hvect_t iv)
void bn_vec_ae(vect_t vec, fastf_t az, fastf_t el)
Definition: mat.c:433
void bn_vtoh_move(vect_t h, const vect_t v)
#define BN_TOL_DIST
Definition: tol.h:109
matp_t bn_mat_dup(const mat_t in)
Definition: mat.c:1046
void bn_mat_trn(mat_t om, const mat_t im)
int bn_mat_ck(const char *title, const mat_t m)
Definition: mat.c:1058
void bn_mat_mul(mat_t o, const mat_t a, const mat_t b)
Support for uniform tolerances.
Definition: tol.h:71
double bn_atan2(double x, double y)
Definition: mat.c:104
void bn_mat_angles(mat_t mat, double alpha, double beta, double ggamma)
void bn_mat_angles_rad(mat_t mat, double alpha, double beta, double ggamma)
double perp
nearly 0
Definition: tol.h:75
void bn_vec_aed(vect_t vec, fastf_t az, fastf_t el, fastf_t dist)
Definition: mat.c:446
void bn_mat_yrot(mat_t m, double siny, double cosy)
void bn_mat_mul3(mat_t o, const mat_t a, const mat_t b, const mat_t c)
Definition: mat.c:156
void bn_mat_xform_about_pt(mat_t mat, const mat_t xform, const point_t pt)
Definition: mat.c:909
double fastf_t
Definition: defines.h:300
void bn_mat_zrot(mat_t m, double sinz, double cosz)