Posted By

Phoenicia7 on 05/14/12


Tagged


Versions (?)

Length 3D


 / Published in: TCL
 

  1. proc _length3d {x1 y1 z1 x2 y2 z2} {
  2. # Procedure to determine 3d length of 2 point line.
  3. set dx [expr $x1 - $x2]
  4. set dy [expr $y1 - $y2]
  5. set dz [expr $z1 - $z2]
  6. return [expr sqrt((sqrt(($dx * $dx) + ($dy * $dy)) * sqrt(($dx * $dx) + ($dy * $dy))) + ($dz * $dz))]
  7. }
  8.  

Report this snippet  

You need to login to post a comment.