|
![](/i/fill.gif) |
SamuelT wrote:
> So, is there a way to get a perfect average from a vector number?
try
$ vec = <1.1, 1.0, 0.9> //initialize the vector
$ av = (vec.x+vec.y+vec.z)/3.0 // get the average
#debug concat(str(av,0,5),"\n") //output the average - 0.90000 - 5 decimal places
or use .red, .green & .blue instead of .x, .y & .z but .x, .y & .z work as well
you could also create a macro
#macro average(vec)
((vec.x+vec.y+vec.z)/3.0)
#end
or did you want something else
Pabs
Post a reply to this message
|
![](/i/fill.gif) |