sm.util.geometricMedian

Numerically approximates the geometric median from a table of points.

Kind: Function

Environments: Game, Terrain

Game

sm.util.geometricMedian( points, initialGuess, iterations )

Open the full Game reference

If no initial guess is made, the mean position of all the points will be used as a guess.

Parameters:

Name Type Description
points table The table of points. { Vec3, ... }.
initialGuess (optional) Vec3 A guessed position to start searching from. (Optional)
iterations (optional) integer The number of iterations. (Defaults to 1)

Returns:

Type Description
Vec3 The estimated geometric median.

Terrain

sm.util.geometricMedian( points, initialGuess, iterations )

Open the full Terrain reference

If no initial guess is made, the mean position of all the points will be used as a guess.

Parameters:

Name Type Description
points table The table of points. { Vec3, ... }.
initialGuess (optional) Vec3 A guessed position to start searching from. (Optional)
iterations (optional) integer The number of iterations. (Defaults to 1)

Returns:

Type Description
Vec3 The estimated geometric median.