On Fri, Apr 18, 2008 at 1:55 PM, aaron trinder <[EMAIL PROTECTED] > wrote:
This is a real noob question i'm sure, but how do i go about redefining negative value data i'm getting (within the range -0,5 to 0.5) so that it works on a scale of 1.0>2.0 ? I can't do this through multiplication in the math patch, and i encounter this type of thing all the time (due to alot of
data sources using negative values).


On 18 Apr 2008, at 14:01, Jonathan del Strother wrote:
Why not just add 1.5?

thanks for that .. thats great, but what about when i want to convert
-0.5 > 0.5 to 1>1000 for example? is there a way of just taking the
whole range and remapping it somehow?


You just need basic remapping arithmetic, like this:

outValue = (inMax == inMin) ? outMin : (outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin))

Dave Howell
Avatron Software
www.avatron.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to