| DistancePowerDistance(Double, Double) Constructor |
Constructs a PowerDistance instance using the given parameters.
Namespace: CenterSpace.NMath.CoreAssembly: NMath (in NMath.dll) Version: 7.4
Syntax public PowerDistance(
double p,
double r
)
Public Sub New (
p As Double,
r As Double
)
public:
PowerDistance(
double p,
double r
)
new :
p : float *
r : float -> PowerDistance
Parameters
- p Double
[Missing <param name="p"/> documentation for "M:CenterSpace.NMath.Core.Distance.PowerDistance.#ctor(System.Double,System.Double)"]
- r Double
[Missing <param name="r"/> documentation for "M:CenterSpace.NMath.Core.Distance.PowerDistance.#ctor(System.Double,System.Double)"]
Remarks
The power distance is computed as:
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