Constructs a PowerDistance instance using the given parameters.

Namespace:  CenterSpace.NMath.Stats
Assembly:  NMathStats (in NMathStats.dll) Version: 3.4.0.0

Syntax

C#
public PowerDistance(
	double p,
	double r
)
Visual Basic (Declaration)
Public Sub New ( _
	p As Double, _
	r As Double _
)
Visual C++
public:
PowerDistance(
	double p, 
	double r
)

Parameters

p
Type: System..::.Double

[Missing <param name="p"/> documentation for "M:CenterSpace.NMath.Stats.Distance.PowerDistance.#ctor(System.Double,System.Double)"]

r
Type: System..::.Double

[Missing <param name="r"/> documentation for "M:CenterSpace.NMath.Stats.Distance.PowerDistance.#ctor(System.Double,System.Double)"]

Remarks

The power distance is computed as:
CopyC#
distance( x, y ) = ( |xi - yi|^p )^1/r
Appropriate selections of p and r yield Euclidean, squared Euclidean, Minkowski, city-block, and many other distance metrics. For example, if p and r are equal to 2, the power distance is equal to the Euclidean distance.

See Also