Interpolatable

public protocol Interpolatable

A type that can be linearly interpolated.

  • The type of the fraction that will be used to linearly interpolate Self.

    Declaration

    Swift

    associatedtype FractionType : FloatingPoint
  • Linearly interpolates Self to another instance of Self based on a given fraction.

    Declaration

    Swift

    func lerp(to: Self, fraction: FractionType) -> Self

    Parameters

    to

    The end value to interpolate to.

    fraction

    The fraction to interpolate between the two values (i.e. 0% is 0.0, 100% is 1.0).

    Return Value

    An interpolated instance of Self.