aboutsummaryrefslogtreecommitdiff
path: root/doc/Manual/en/BH_Plane.pod
blob: 6943e86ee92cc01606904a329ec89c2a19822e51 (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
=encoding UTF-8


=head1 NAME

BH_Plane - Plane in space


=head1 SYNTAX

 #include <BH/Math.h>
 
 cc prog.c -o prog -lbh
 

=head1 DESCRIPTION

The BH_Plane module provides functions for working with planes in 
three-dimensional space. It allows you to calculate the coefficients of a plane 
from three points, determine the distance from a point to a plane, and find the 
closest point on the plane to a given point.


=head1 API CALLS


=head2 BH_PlaneFromPoints

 int BH_PlaneFromPoints(const float a[3],
                        const float b[3],
                        const float c[3],
                        float out[4]);

Calculates the coefficients of a plane from three points I<a>, I<b>, I<c>.

It is assumed that the points are arranged in a clockwise order.

If the points form a degenerate triangle, the function will return an error.

The I<out> parameter defines the resulting plane.

If successful, the function returns 0, otherwise it returns an error code.


=head2 BH_PlaneDistance

 float BH_PlaneDistance(const float plane[4],
                        const float point[3]);

Calculates the distance from the I<point> to the I<plane>.


=head2 BH_PlaneClosestPoint

 void BH_PlaneClosestPoint(const float plane[4],
                           const float point[3],
                           float out[3]);

Calculates the closest point on the I<plane> to another I<point>.

The I<out> parameter describes the resulting point.


=head1 SEE ALSO

L<BH>