> I am trying to build an application that produces a 2d "heat map". 
> Ideally the dataset would be populated by objects such as this:
> 
> {id:0, x:0,y:0,rectangle:Rectangle,value:100} where value is between 0
> (cold) and 100 (hot).
> These objects would represent "points of interest" on another 
> surface, such as a map of a city to map out population count 
> or other statistics.
> 
> My problem is, given that one object is a small rectangle far 
> up left, and another is a wide rectangle at the very bottom, 
> how would i interpolate colors between these positions?
> 
> I'm fully aware that this is far beyond what i've done before 
> with colors or even interpolation et al. Any ideas would be 
> grand, because i'm feeling blank at the moment :(

Just some initial thoughts (written as I think, so a bit rambling):

It sounds like you need to set the value at any particular point according
to the distance from the centres of gravity of the various rectangles,
weighted by the areas of those rectangles (so a big recrangle with a
particular temperature has more impact than a small rectangle with the same
temperature. But that's going to probably going to give some odd results
around the corners of a narrow rectangle. Another option would be to work it
based on the minimum distance from the perimeter from each rectangle (but
then I think you might want to not weight it by the area). So really your
problem boils down to the question of what the 'distance' function you want
is. And I guess that in turn depends on how you're modeling your heat.

It occurs to me that really you're suffering from the problem that you're
trying to model *heat* with *temperature*, which are different things.
Perhaps instead of modelling your rectangles as areas of a particular
temperature, you might model them as areas of a particular wattage. Then you
can use the inverse square law to determine how much energy reaches any one
point.

HTH
Danny

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to