"rope" - mkraska/meclib GitHub Wiki

[ "rope", "name", [x1, y1], r1, [x2,y2], r2, state ]

Tangent line to two circles with center and radius given. Negative r values select the tangent point on the left side from the line C1-C2. Represents ropes running between disks.

  • "name" label text, typeset as normal text. Add \\( and \\) to enforce math mode.
  • [x1, y1] center of first disk
  • r1 radius of first disk (can be zero, then line starts at the center)
  • [x2, y2] center of second disk
  • r2 radius of second disk (can be zero, then line ends at the center)
  • state (optional, default: "locked") "locked", "hide" or "show". If missing, object can't be switched interactively.

Example

image

image

[
  [ "grid", "x","y", -5,5,-4,5, 50, [10,10], [0,0] ],
  [ "circle", "", [2, 2], 0.5 , 0],
  [ "circle", "", [3, 4], 0.5 , 0],
  [ "rope", "", [2, 2], -0.5, [3,4], 0.5 ],
  [ "point", "1", [2,2] ],
  [ "point", "2", [3,4] ],
  [ "dir", "r1", [2,2], -45, 9, 0.5],
  [ "dir", "r2", [3,4], 0, 9, 0.5],
  [ "label", "name", [2.7, 3] ]
]

Objects

  • l (segment) line
    • l.point1 (point) start point
    • l.point2 (point) end point
    • l.L() (number) length