001// Copyright (c) FIRST and other WPILib contributors.
002// Open Source Software; you can modify and/or share it under the terms of
003// the WPILib BSD license file in the root directory of this project.
004
005package edu.wpi.first.math.interpolation;
006
007/**
008 * An object should extend interpolatable if you wish to interpolate between a lower and upper
009 * bound, such as a robot position on the field between timesteps. This behavior can be linear or
010 * nonlinear.
011 *
012 * @param <T> The class that is interpolatable.
013 */
014public interface Interpolatable<T> {
015  /**
016   * Return the interpolated value. This object is assumed to be the starting position, or lower
017   * bound.
018   *
019   * @param endValue The upper bound, or end.
020   * @param t How far between the lower and upper bound we are. This should be bounded in [0, 1].
021   * @return The interpolated value.
022   */
023  T interpolate(T endValue, double t);
024}