ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cv/mgflib/vect.h
Revision: 1.3
Committed: Sat Jun 7 01:11:17 2003 UTC (20 years, 10 months ago) by schorsch
Content type: text/plain
Branch: MAIN
CVS Tags: rad3R7P1, rad4R0, rad3R6, rad3R6P1, rad3R8, rad3R9, rad3R7P2
Changes since 1.2: +11 -3 lines
Log Message:
Instrumented headers against multiple inclusion and for use from C++.
Removed NOPROTO sections.

File Contents

# Content
1 /* RCSid: $Id: vect.h,v 1.2 2003/02/28 20:11:30 greg Exp $ */
2 #ifndef _MGF_VECT_H_
3 #define _MGF_VECT_H_
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8
9 #include <stdio.h>
10
11 typedef float Vector[3];
12
13 #define X 0
14 #define Y 1
15 #define Z 2
16
17 /* Transformation matrix */
18 typedef float Matrix[4][4];
19
20 void vect_init (Vector v, float x, float y, float z);
21 void vect_copy (Vector v1, Vector v2);
22 int vect_equal (Vector v1, Vector v2);
23 void vect_add (Vector v1, Vector v2, Vector v3);
24 void vect_sub (Vector v1, Vector v2, Vector v3);
25 void vect_scale (Vector v1, Vector v2, float k);
26 float vect_mag (Vector v);
27 void vect_normalize (Vector v);
28 float vect_dot (Vector v1, Vector v2);
29 void vect_cross (Vector v1, Vector v2, Vector v3);
30 void vect_min (Vector v1, Vector v2, Vector v3);
31 void vect_max (Vector v1, Vector v2, Vector v3);
32 float vect_angle (Vector v1, Vector v2);
33 void vect_print (FILE *f, Vector v, int dec, char sep);
34 void vect_rotate (Vector v1, Vector v2, int axis, float angle);
35 void vect_axis_rotate (Vector v1, Vector v2, Vector axis, float angle);
36 void mat_identity (Matrix mat);
37 void mat_copy (Matrix mat1, Matrix mat2);
38 void mat_rotate (Matrix mat1, Matrix mat2, int axis, float angle);
39 void mat_axis_rotate (Matrix mat1, Matrix mat2, Vector axis, float angle);
40 void mat_mult (Matrix mat1, Matrix mat2, Matrix mat3);
41 void vect_transform (Vector v1, Vector v2, Matrix mat);
42 void mat_decode (Matrix mat, Vector scale, Vector shear, Vector rotate, Vector
43 transl);
44 float mat_inv (Matrix mat1, Matrix mat2);
45
46
47 #ifdef __cplusplus
48 }
49 #endif
50 #endif /* _MGF_VECT_H_ */