The way I understood your problem, for known $a$ and $b$, you want to find such $a'$, that $c' = a$. By $a'$ and $c'$ I mean changed lengths of the triangle sides when the vertex connecting $a$ and $c$ moves.
$a'^2 + b^2 = c'^2$  |  $c' = a$
$a'^2 + b^2 = a^2$  |  $-b^2$
$a'^2 = a^2 - b^2$  |  $\sqrt {}$
$a' = \sqrt {a^2 - b^2}$
Once you have that, you need to move along normalized vector $\overrightarrow{a}$ by the difference between $a$ and $a'$. So you need to apply an offset $n(\overrightarrow{a}) \times (a - a')$.
So with this setup:
We get:
For it to work, you need to set the dragged vertex'es index to 0 (select the vertex, Mesh > Sort Elements > Selected).
Edge lengths will change for points that aren't directly connected to the directly dragged vertex:
I don't think you can find the shortest path in geometry nodes, but what you could do is manually assign some information on the connections to the geometry, e.g. you could add a vertex group, assign it to all vertices with value 0.0
, and then assign e.g. a value 0.51
to vertex #8:
So that in the nodes you can multiply these values by 10 and have it truncate (keep in mind 0.7
is saved as 0.699999988079071044921875
in float, that's why I add a threshold in the form of 0.01
to the number, so I can just truncate the number. But rounding would work instead...) so the fraction is removed during conversion to integer, in order to obtain the coordinate of the connected vertex rather than always just one vertex:
However, in the first node setup I'm just using the info on how the dragged vertex will be moved, in order to calculate how to move neighboring vertices and only then move the dragged vertex. I could move them all at once with only one Set Position node, or I could also have two s.p. nodes, moving the dragged vertex first, and then using the evaluated position for other vertices. But this means for each level of depth, you need a separate Set Position node, at least to my (limited) understanding...
The laziest idea I have is that you just select the dragged vertex, sort it, select more, sort, and so on to quickly sort everything inside out:
(select the directly dragged vertex, Mesh > Sort Elements > Selected, or use F3 as on GIF, CtrlNumpad + to select more and repeat until everything is sorted from inside out).
Then as described above, manually assign info on indices to nearest dragging vertices, for complex geometry this could be done with a Python script + "shortest path" operator (or some bmesh code by batFinger surely flying around).
Then you would create a node setup that isn't hardcoded to look for index 0
but rather looks for index as in the vertex group, and finally (the laziest part), just take it all, pack into a custom group, and duplicate a few times (as many times as the number of depth levels you want to support), so after one level is evaluated, the next have to update as well in order to stay in correct distance...