Back to index

radiance  4R0+20100331
mat4.h
Go to the documentation of this file.
00001 /* RCSid $Id: mat4.h,v 2.12 2003/07/14 22:23:59 schorsch Exp $ */
00002 /*
00003  * Definitions for 4x4 matrix operations
00004  */
00005 #ifndef _RAD_MAT4_H_
00006 #define _RAD_MAT4_H_
00007 
00008 #include  <string.h>
00009 
00010 #include  "fvect.h"
00011 
00012 #ifdef __cplusplus
00013 extern "C" {
00014 #endif
00015 
00016 typedef RREAL  MAT4[4][4];
00017 
00018 #define  copymat4(m4a,m4b)  (void)memcpy((void *)m4a,(void *)m4b,sizeof(MAT4))
00019 
00020 #define  MAT4IDENT          { {1.,0.,0.,0.}, {0.,1.,0.,0.}, \
00021                             {0.,0.,1.,0.}, {0.,0.,0.,1.} }
00022 
00023 extern MAT4  m4ident;
00024 
00025 #define  setident4(m4)             copymat4(m4, m4ident)
00026 
00027 
00028 extern void   multmat4(MAT4 m4a, MAT4 m4b, MAT4 m4c);
00029 extern void   multv3(FVECT v3a, FVECT v3b, MAT4 m4);
00030 extern void   multp3(FVECT p3a, FVECT p3b, MAT4 m4);
00031 extern int    invmat4(MAT4 inverse, MAT4 mat);
00032 
00033 
00034 #ifdef __cplusplus
00035 }
00036 #endif
00037 #endif /* _RAD_MAT4_H_ */
00038