calculate_interpolation_step

Function calculate_interpolation_step 

Source
pub fn calculate_interpolation_step(
    d1: DatumRef<'_>,
    d2: DatumRef<'_>,
    steps: usize,
) -> Datum
Expand description

Calculates the step size for interpolation between two values.

§Parameters

  • d1: The starting value as a DatumRef.
  • d2: The ending value as a DatumRef.
  • steps: The number of steps to interpolate between d1 and d2.

§Returns

Returns a Datum representing the step size for each interpolation step, or None if the input values are not compatible or steps is zero.

§Calculation

For supported types, computes (d2 - d1) / steps and returns the result as a Datum.