LocationCalculateRatio Method

Calculate the ratio of the inter Location position in between the start (sc) and end (ec) locations, such that v = (1-ratio)*v_sc + ratio*v_ec If inter is not in between sc and ec, ratio can be negative or larger than one.

Definition

Namespace: DHI.Mike1D.Generic
Assembly: DHI.Mike1D.Generic (in DHI.Mike1D.Generic.dll) Version: 24.0.0.0 (11.1.1.1111)
C#
public static double CalculateRatio(
	ILocation startLocation,
	ILocation endLocation,
	ILocation inter
)

Parameters

startLocation  ILocation
Start location - usually chainage less than inter
endLocation  ILocation
End location - usually chainage larger than inter
inter  ILocation
Intermediate location.

Return Value

Double
The ratio of the position between start and end location

Remarks

if start and end location equals, 0.5 is returned.

See Also