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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
|
=encoding UTF-8
=head1 NAME
BH_Mat3f - a real 3x3 matrix
=head1 SYNTAX
#include <BH/Math/Mat3f.h>
cc prog.c -o prog -lbh
=head1 DESCRIPTION
The BH_Mat3f module provides a set of functions for working with real 3x3
matrices.
=head1 API CALLS
=head2 BH_Mat3fIdentity
void BH_Mat3fIdentity(float out[9]);
Writes an identity matrix to I<out>.
=head2 BH_Mat3fAdd
void BH_Mat3fAdd(const float a[9],
const float b[9],
float out[9]);
Calculates the sum of two matrices I<a> and I<b>.
The I<out> parameter describes the resulting matrix.
=head2 BH_Mat3fSub
void BH_Mat3fSub(const float a[9],
const float b[9],
float out[9]);
Calculates the difference between two matrices I<a> and I<b>.
The I<out> parameter describes the resulting matrix.
=head2 BH_Mat3fMul
void BH_Mat3fMul(const float a[9],
const float b[9],
float out[9]);
Calculates the result of multiplying two matrices I<a> and I<b>.
The I<out> parameter describes the resulting matrix.
=head2 BH_Mat3fScale
void BH_Mat3fScale(const float a[9],
float b,
float out[9]);
Calculates the result of multiplying matrix I<a> by value I<b>.
The I<out> parameter describes the resulting matrix.
=head2 BH_Mat3fTranspose
void BH_Mat3fTranspose(const float in[9],
float out[9]);
Transposes matrix I<in>.
The I<out> parameter describes the resulting matrix.
=head2 BH_Mat3fTrace
float BH_Mat3fTrace(const float in[9]);
Calculates the sum of the elements of the main diagonal of matrix I<in>.
=head2 BH_Mat3fDet
float BH_Mat3fDet(const float in[9]);
Calculates the determinant of matrix I<in>.
=head2 BH_Mat3fInverse
int BH_Mat3fInverse(const float in[9],
float out[9]);
Calculates the inverse matrix for I<in>.
The I<out> parameter describes the resulting matrix.
If successful, the function returns 0, otherwise it returns an error code.
=head2 BH_Mat3fFromScale
void BH_Mat3fFromScale(float x,
float y,
float out[9]);
Calculates a scaling matrix with scales I<x> and I<y>.
The I<out> parameter describes the resulting matrix.
=head2 BH_Mat3fFromTranslation
void BH_Mat3fFromTranslation(float x,
float y,
float out[9]);
Calculates a translation matrix with values I<x> and I<y>.
The I<out> parameter describes the resulting matrix.
=head2 BH_Mat3fFromRotation
void BH_Mat3fFromRotation(float angle,
float out[9]);
Calculates a rotation matrix with a given I<angle>.
The I<out> parameter describes the resulting matrix.
=head2 BH_Mat3fApplyVec3f
void BH_Mat3fApplyVec3f(float a[9],
float b[3],
float out[3]);
Calculates the result of multiplying matrix I<a> by vector I<b>.
The I<out> parameter describes the resulting vector.
=head2 BH_Mat3fApplyVec2f
void BH_Mat3fApplyVec2f(float a[9],
float b[2],
float out[2]);
Calculates the result of multiplying matrix I<a> by vector I<b>.
The I<out> parameter describes the resulting vector.
=head1 SEE ALSO
L<BH>
|