The Cuik KD-Tree Library
rectangle.c File Reference Implementation of the functions operating on Trectangle. More... #include "rectangle.h" #include "random.h" #include "definitions.h" #include <string.h> #include <stdlib.h> #include <math.h> #include <assert.h> ![]() Go to the source code of this file.
Detailed DescriptionImplementation of the functions operating on Trectangle.
Definition in file rectangle.c. Function Documentation
Creates a new rectangle with the given parameters.
Definition at line 20 of file rectangle.c. References Trectangle::l, Trectangle::n, NEWZ, and Trectangle::u. Referenced by main(). ![]()
Creates a new rectangle with punctual intervals from a given vector.
Definition at line 35 of file rectangle.c. References Trectangle::l, Trectangle::n, NEW, and Trectangle::u. Referenced by AddPoint2KDtree(), and BuildKDTree(). ![]()
Returns the number of ranges defining the rectangle.
Definition at line 47 of file rectangle.c. References Trectangle::n. Referenced by InitKDTree(). ![]()
Expands a rectangle so that it includes a given point.
Definition at line 52 of file rectangle.c. References Trectangle::l, Trectangle::n, and Trectangle::u. Referenced by AddPoint2KDtree(), and BuildKDTree(). ![]()
Adds a border to a box, but without scaping a given limits
Definition at line 68 of file rectangle.c. References Trectangle::l, Trectangle::n, and Trectangle::u. Referenced by AddPoint2KDtree(), and BuildKDTree(). ![]()
Copies one rectangle into another.
Definition at line 91 of file rectangle.c. References Trectangle::l, Trectangle::n, NEW, and Trectangle::u. Referenced by AddPoint2KDtree(), and BuildKDTree(). ![]()
Gets the lower limit along a given dimension.
Definition at line 101 of file rectangle.c. References Trectangle::l.
Gets the upper limit along a given dimension.
Definition at line 108 of file rectangle.c. References Trectangle::u.
Gets the lower and upper limit of a rectangle along a given dimension.
Definition at line 115 of file rectangle.c. References Trectangle::l, and Trectangle::u. Referenced by BuildKDTree(), and InitKDTree(). ![]()
Set the lower limit along a given dimension.
Definition at line 123 of file rectangle.c. References Trectangle::l. Referenced by BuildKDTree(), and main(). ![]()
Set the upper limit along a given dimension.
Definition at line 130 of file rectangle.c. References Trectangle::u. Referenced by BuildKDTree(), and main(). ![]()
Changes the lower and the upper limit along a given dimension.
Definition at line 137 of file rectangle.c. References Trectangle::l, and Trectangle::u. Referenced by BuildKDTree(), and InitKDTree(). ![]()
Computes a random point along the selected dimensions.
Definition at line 145 of file rectangle.c. References Trectangle::l, Trectangle::n, randomDouble(), and Trectangle::u. Referenced by main(), and SampleInKDtree(). ![]() ![]()
Squared distance of a value to the interval defining a rectangle along a given dimension.
Definition at line 153 of file rectangle.c. References ANGLE_ACCURACY, Trectangle::l, M_2PI, M_PI, PI2PI, TOPOLOGY_R, and Trectangle::u. Referenced by SearchInBallKDtree(), and SearchKDtree(). ![]()
Computes the minimum squared distance from a point to a rectangle but considering a possible special topology for the input rectangle and the input point.
Definition at line 230 of file rectangle.c. References ANGLE_ACCURACY, Trectangle::l, M_2PI, M_PI, Trectangle::n, PI2PI, TOPOLOGY_R, and Trectangle::u. Referenced by SearchInBallKDtree(), and SearchKDtree(). ![]()
Computes the rectangle dimension for which it is better to split the rectangle. Right now this function is an alias to GetRectangleMaxDim.
Definition at line 344 of file rectangle.c. References Trectangle::l, Trectangle::n, and Trectangle::u. Referenced by BuildKDTree(). ![]()
Prints a rectangle. Used for debug.
Definition at line 365 of file rectangle.c. References Trectangle::l, Trectangle::n, and Trectangle::u. Referenced by PrintKDtree(). ![]()
Deletes a previously generated rectangle.
Definition at line 375 of file rectangle.c. References Trectangle::l. Referenced by DeleteKDtree(), and main(). ![]() |
Follow us!