A rectangle is drawn, Path > Object to Path is applied to get a proper path with nodes at the corners
A triangle is drawn with the Bezier tool (=the Pen). It snaps exactly if you have snaps to nodes ON.
Two more triangles are drawn
All is selected (see NOTE1) and the midpoint nodes are selected by dragging with the node tool over them. Then the selected nodes are moved together with the node tool.
NOTE1: In Inkscape you must at first select the parts with the normal selection tool to be sure the node tool takes all nodes in the same place when you drag a selection rectangle with the node tool.
ADD: Thanks to user Billy Kerr for inserting this animation.
To make the same with curved part seams probably needs something else. But if there's only the midpoint node and nodes in the corners of the rectangle it works. In the next image the parts have hefty overlaps to avoid gaps when the midpoint is moved:
If it happens that you need a way to unite or bind together the parts so that they keep their colors and you can move the midpoint by moving one single item without causing gaps, not several simultaneously selected nodes, you want something that Inkscape doesn't have. CAD software and advanced animation software have "constraints" which keep things together.
Another way is to use some geometric deformation and adjust it to get apparent midpoint movement. I must skip these subjects due missing advanced animation or pro level parametric CAD software and actual skills how to use them.
But one "move only single item" version is possible in elementary way also in entry level freeware CAD. It's "Move the top vertex of a 3D four side colored pyramide":
The pyramide is a 3D solid, it's not separate paths like the triangles in the Inkscape version. Top view makes it look planar: