Scales

tangible.scales.linear(domain, codomain, clamp=False)[source]

Return a function to linearly scale the values in the domain range to values in the codomain range.

Parameters:
  • domain (A 2-tuple.) – The scale’s input domain.
  • codomain (A 2-tuple.) – The scale’s output range / codomain.
  • clamp – Whether or not to clamp the output values to the codomain.

Default False. :type clamp: bool :returns: A function that takes a single number as argument and returns

another number.