rotate

rotate x y phi cX cY
rotates coordinates x, y by angle phi around center cX, cY

obj inscope dot proc rotate {x y phi cX cY} {
  # coords x, y rotated by phi around cX, cY
  set c [cos $phi]
  set s [sin $phi]
  list\
    [expr {($x - $cX) * $c - ($y - $cY) * $s + $cX}]\
    [expr {($y - $cY) * $c + ($x - $cX) * $s + $cY}]
}

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