Automatic adjustment of coordinates #678
-
Consider the following code. My question is: If one moves the second circle (
|
Beta Was this translation helpful? Give feedback.
Answered by
johannes-wolf
Aug 10, 2024
Replies: 2 comments
-
I guess you want something dynamic like the following: #import "@preview/cetz:0.2.2"
#set page(width: auto, height: auto)
#cetz.canvas({
import cetz.draw: *
set-style(circle: (radius: 0.8em))
circle((0,0), name: "circ1")
circle((2,2), name: "circ2")
line("circ1", /* Intersection of a straight line between circ1.center and the next coordinate */
((), "-|", ("circ1", 50%, "circ2")), /* Move only horizontal to (circ1.x + circ2.x)/2 */
((), "|-", "circ2"), /* Move vertically to circ2.y */
"circ2", /* Same as 1. but for circ2 */
mark: (start: ">", fill: black))
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
psads-git
-
That is a perfect solution, @johannes-wolf! Thank you very much indeed! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I guess you want something dynamic like the following:
With
"circ2"
at(…