tangensTo

$line tangensTo $other
calculates common tangens to other line object, then intersects $line and $other, then draws tangens line. Returns list of intersect results and tangens line.

obj method line tangensTo other {
  if {
    [$self cget -smooth] &&
    [$other isa line] &&
    [$other cget -smooth]
  } then {
    lassign [bezier tangens2 [$self xy] [$other xy]] myFrac otherFrac
    set line1 [$self intersect $myFrac]
    set line2 [$other intersect $otherFrac]
    set line3 [new line\
        [$self lastDot cget -x] [$self lastDot cget -y]\
        [$other lastDot cget -x] [$other lastDot cget -y]]
    list $line1 $line2 $line3
  }
}

© Wolf-Dieter Busch | Home | Sitemap | Urheber | A-Z