Hallo, cyborgk@nocturnalnoize.com hat gesagt: // cyborgk@nocturnalnoize.com wrote:
You almost made me crazy, because you gave the wrong formula, and I thought expr didn't work! ;)
I think the 3d distance is: [expr sqrt(($f4-$f1)*($f4-$f1) + ($f5-$f2)*($f5-$f2) + ($f6-$f3)*($f6-$f3)) ]
Ah, yes, of course, I don't know what I was thinking about when I made up my completely wrong formula. Sorry for disturbing you, your version is of course right and mine is utter nonsense for the task at hand.
At least [expr] still is the tool to use. ;)
Frank Barknecht _ ______footils.org_ __goto10.org__
Hallo, Frank Barknecht hat gesagt: // Frank Barknecht wrote:
Ah, yes, of course, I don't know what I was thinking about when I made up my completely wrong formula.
Okay, I know what I was thinking about now:
[expr sqrt($f1*$f1 + $f2*$f2 + $f3*$f3)]
will calculate the geometric length of a 3-dimensional vector. This can be useful to have in an abstraction, so you don't have to type it.
If you use this to calculate the length of the difference vector, you get the distance. You can either do that as in your fixed version of my wrong formula, or you can calculate the difference vector in a seperate object like:
[expr $f1-$f4; $f2-$f5; $f3-$f6]
Attached is proof, that I tested it this time. ;)
Frank Barknecht _ ______footils.org_ __goto10.org__