I used to sleep a lot in math class... For this question https://groups.google.com/forum/m/#!topic/comp.lang.tcl/iOedyEIUC4E%|%Calculating Distance from a Point to a Plane %|%I can answer... Maybe there’s a faster way to calculate... ====== namespace eval Vector3D { namespace export * proc sub_v3v3 {v0 v1} { lassign $v0 v0x v0y v0z lassign $v1 v1x v1y v1z return [list [expr {$v0x - $v1x}] \ [expr {$v0y - $v1y}] \ [expr {$v0z - $v1z}]] } proc dot_v3v3 {v0 v1} { lassign $v0 v0x v0y v0z lassign $v1 v1x v1y v1z return [expr {($v0x * $v1x) + ($v0y * $v1y) + ($v0z * $v1z)}] } proc cross_v3v3 {v0 v1} { lassign $v0 vx0 vy0 vz0 lassign $v1 vx1 vy1 vz1 return [list [expr {($vy0 * $vz1) - ($vy1 * $vz0)}] \ [expr {($vz0 * $vx1) - ($vx0 * $vz1)}] \ [expr {($vx0 * $vy1) - ($vy0 * $vx1)}]] } proc norm {v} { lassign $v vx vy vz return [expr {sqrt($vx**2 + $vy**2 + $vz**2)}] } proc unit {v} { set n [norm $v] if {$n == 0} { error "Must be greatest than 0..." } lassign $v x y z return [list [expr {$x / double($n)}] \ [expr {$y / double($n)}] \ [expr {$z / double($n)}]] } } ====== * Utilisation : ====== namespace import Vector3D::* set plan {{-10 -10 10} {10 -10 10} {0 10 10}} ; # 3 points on plan (3d) set point {0 0 12} ; # point (3d) lassign $plan v0 v1 v2 set u [sub_v3v3 $v1 $v0] set v [sub_v3v3 $v2 $v0] set normal [unit [cross_v3v3 $u $v]] ; # normal to plane set sub [sub_v3v3 $point $v0] set dist [dot_v3v3 $normal $sub] puts "Distance 3D = $dist" # Distance 3D = 2.0 ======