add scale

This commit is contained in:
Chris Danford
2005-03-12 06:04:41 +00:00
parent 1d2a5be213
commit 9877a12111
@@ -30,6 +30,12 @@ function TableMetricLookup( t, group )
return ret return ret
end end
-- Scales x so that l1 corresponds to l2 and h1 corresponds to h2.
function scale( x, l1, h1, l2, h2 )
return (((x) - (l1)) * ((h2) - (l2)) / ((h1) - (l1)) + (l2))
end
-- (c) 2005 Glenn Maynard -- (c) 2005 Glenn Maynard
-- All rights reserved. -- All rights reserved.
-- --