Package org.tinfour.utils
Class Tincalc
- java.lang.Object
-
- org.tinfour.utils.Tincalc
-
public final class Tincalc extends Object
Provides simple calculations useful for various Tinfour operations.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static doublesampleSpacing(double area, int n)Estimates the average distance between point samples distributed randomly within a specified area with approximately uniform density, specified in arbitrary units.
-
-
-
Method Detail
-
sampleSpacing
public static double sampleSpacing(double area, int n)Estimates the average distance between point samples distributed randomly within a specified area with approximately uniform density, specified in arbitrary units.The approximation used by this method makes the simplifying assumption that the points are organized in a regular tessellation of equilateral triangles. For a sufficiently large number of points, N, the number of triangles in the tessellation approaches 2N. And, for area, A, the area of individual triangles approaches A/2N. The approximate space between points is just the length of the side of one of these triangles.
The quality of this estimate improves with increasing point count and input data that conforms to the assumptions of the approximation. Note that the 2N triangle ratio is also true for Delaunay Triangulations.
- Parameters:
area- the area of the region containing pointsn- the number of points- Returns:
- a distance value (units given in the square root of the area units)
-
-