Skip to content

Commit 397f506

Browse files
committed
Updated README.md
1 parent f6260d1 commit 397f506

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

README.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,30 @@
1-
Delaunay triangulation implemented as a C++ template:
1+
Delaunay triangulation implemented as a C++ template. The implementation is pretty
2+
straightforward, without any optimizaion. It runs in O(n^2) time, and might take forever
3+
if you have more than a few hundred points.
24

5+
The interface:
6+
7+
```
38
template <typename T>
49
void delaunay (const std::vector<Point<T> >& pSet, std::set <Triangle>& trSet)
10+
```
11+
12+
* Input: vector of `Point`s
13+
* Output: set of `Triangle`s
14+
15+
Both `Point` and `Triangle` are defined and documented in `dtypes.h`
16+
17+
Typically type `T` is either `float` or `double`. When invoked with integer types it converts
18+
them internally to `double`s.
19+
20+
Here is an example of invocation for a set of random points, where `DRAND` is expected to
21+
return a randomly generated double-precision floating point number:
522

6-
Input: vector of Point's
7-
Output: set of Triangle's
23+
```
24+
std::vector<Point<double> > pSet;
25+
std::set <Triangle> trSet;
26+
for (int k=0; k<numPoints; k++)
27+
pSet.push_back (Point<double> (DRAND(), DRAND()));
28+
delaunay (pSet, trSet);
29+
```
830

9-
Both Point's and Triangle's are defined in 'dtypes.h'

0 commit comments

Comments
 (0)