aboutsummaryrefslogtreecommitdiff
path: root/doc/Manual/en/BH_Vec4f.pod
blob: 7ca222260f8716c55f57bbb2ff6dabe7594cf729 (plain)
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
=encoding UTF-8


=head1 NAME

BH_Vec4f - four-dimensional real vector


=head1 SYNTAX

 #include <BH/Math.h>

 cc prog.c -o prog -lbh


=head1 DESCRIPTION

The BH_Vec4f module provides a set of functions for working with
four-dimensional vectors. The functions allow performing arithmetic operations,
normalization, calculating the dot product, and other mathematical operations
on vectors.


=head1 API CALLS


=head2 BH_Vec4fAdd

 void BH_Vec4fAdd(const float a[4],
                  const float b[4],
                  float out[4]);

Calculates the sum of two vectors I<a> and I<b>.

The I<out> parameter describes the resulting vector.


=head2 BH_Vec4fSub

 void BH_Vec4fSub(const float a[4],
                  const float b[4],
                  float out[4]);

Calculates the difference between two vectors I<a> and I<b>.

The I<out> parameter describes the resulting vector.


=head2 BH_Vec4fMul

 void BH_Vec4fMul(const float a[4],
                  const float b[4],
                  float out[4]);

Calculates the result of multiplying two vectors I<a> and I<b>.

The I<out> parameter describes the resulting vector.


=head2 BH_Vec4fScale

 void BH_Vec4fScale(const float a[4],
                    float b,
                    float out[4]);

Calculates the result of multiplying vector I<a> by value I<b>.

The I<out> parameter describes the resulting vector.


=head2 BH_Vec4fMulAdd

 void BH_Vec4fMulAdd(const float a[4],
                     const float b[4],
                     const float c[4],
                     float out[4]);

Calculates the result of the sum I<c> and the result of multiplying vectors I<a>
and I<b>.

The I<out> parameter describes the resulting vector.


=head2 BH_Vec4fNegate

 void BH_Vec4fNegate(const float in[4],
                     float out[4]);

Calculates the opposite vector from vector I<in>.

The I<out> parameter describes the resulting vector.


=head2 BH_Vec4fDot

 float BH_Vec4fDot(const float a[4],
                   const float b[4]);

Calculates the dot product of vectors I<a> and I<b>.


=head2 BH_Vec4fLength

 float BH_Vec4fLength(const float in[4]);

Calculates the length of vector I<in>.


=head2 BH_Vec4fNormal

 void BH_Vec4fNormal(const float in[4],
                     float out[4]);

Calculates the normalized form of vector I<in>.

The I<out> parameter describes the resulting vector.


=head2 BH_Vec4fNormalEx

 float BH_Vec4fNormalEx(const float in[4],
                        float out[4]);

Calculates the normalized form of vector I<in> and returns its original length.

The I<out> parameter describes the resulting vector.


=head2 BH_Vec4fMin

 void BH_Vec4fMin(const float a[4],
                  const float b[4],
                  float out[4]);

Calculates the element-wise minimum of two vectors I<a> and I<b>.

The I<out> parameter describes the resulting vector.


=head2 BH_Vec4fMax

 void BH_Vec4fMax(const float a[4],
                  const float b[4],
                  float out[4]);

Calculates the element-wise maximum of two vectors I<a> and I<b>.

The I<out> parameter describes the resulting vector.


=head2 BH_Vec4fLerp

 void BH_Vec4fLerp(const float a[4],
                   const float b[4],
                   float t,
                   float out[4]);

Performs linear interpolation between two vectors I<a> and I<b> with parameter
I<t>.

The I<out> parameter describes the resulting vector.


=head2 BH_Vec4fProject

 void BH_Vec4fProject(const float a[4],
                      const float b[4],
                      float out[4]);

Calculates the result of projecting vector I<a> onto vector I<b>.

The I<out> parameter describes the resulting vector.


=head2 BH_Vec4fBarycentric

 void BH_Vec4fBarycentric(const float a[4],
                          const float b[4],
                          const float c[4],
                          float v,
                          float w,
                          float out[4]);

Calculates the vector from barycentric coordinates I<v>, I<w> and vectors of
points I<a>, I<b>, I<c>.

The calculation is performed using the formula A + v*(B-A) + w*(C-A).

The I<out> parameter describes the resulting vector.


=head1 SEE ALSO

L<BH>