File: figure-48-point-vectoradd.dia

package info (click to toggle)
tklib 0.6-1
  • links: PTS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 16,012 kB
  • sloc: tcl: 65,204; sh: 6,870; ansic: 792; pascal: 359; makefile: 73; exp: 21; sed: 16
file content (15 lines) | stat: -rw-r--r-- 377 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# -*- tcl -*- tcl.tk//DSL diagram//EN//1.0
proc vector {p args} {
    circle radius 2 at $p color red
    arrow  {*}$args from [0 0] to $p 
}

set p [100  50]
set d [100 -50]

set P [vector $p        text P below]
set D [vector $d        text D above]
vector [$p + $d] text P+D above

arrow dotted from [$P end] to [[$P end] + $d]
arrow dotted from [$D end] to [[$D end] + $p]