Temp from distance

  • Videogamer555
    28th Dec 2011 Member 0 Permalink
    The farther away an electron is from the point of origin the hotter it will be. If it reflects off something and approaches the point of origin it will get colder again.

    function test_update(i, x, y, s, n)
    if tpt.get_property("tmp",i) == 0 then
    tpt.parts[i].tmp=x
    tpt.parts[i].tmp2=y
    end
    ix=tpt.get_property("tmp",i)
    iy=tpt.get_property("tmp2",i)
    tpt.parts[i].temp=20*math.sqrt((x-ix)^2 +(y-iy)^2)
    end
    tpt.element_func(test_update, tpt.el.elec.id)