If your central point is $(c_x,c_y)$ and you want to rotate counter-clockwise about this point by an angle of $\theta$ (in radians) you would shift the center to the origin (and the rest of the points of the plane with it), then rotate, then shift back. You can use:
$x_{\text{rot}}=\cos(\theta)\cdot(x-c_x)-\sin(\theta)\cdot(y-c_y)+c_x$
$y_{\text{rot}}=\sin(\theta)\cdot(x-c_x)+\cos(\theta)\cdot(y-c_y)+c_y$
$(x,y)$ are your initial coordinates and $(x_\text{rot},y_{\text{rot}})$ are the new coordinates after rotation by $\theta$ about $(c_x,c_y)$
Example: If you want to rotate the point $(3,0)$ by $90^{\circ}$=$\frac{\pi}{2}$ radians about the point $(3,2)$ the formula should give $(5,2)$. Computing to check:
$x_{\text{rot}}=\cos(\frac{\pi}{2})\cdot(3-3)-\sin(\frac{\pi}{2})\cdot(0-2)+3=5$
$y_{\text{rot}}=\sin(\frac{\pi}{2})\cdot(3-3)+\cos(\frac{\pi}{2})\cdot(0-2)+2=2$
If you know the branch vector $\vec b = (x_0, y_0, z_0)$, then any vector perpendicular to it , say $\vec p = (x_1, y_1, z_1)$ will have dot product $0$.
So,
$$
\vec b . \vec p = x_0x_1 + y_0y_1 + z_0z_1 = \vec0 \\\text{dot product is zero as they are perpendicular}
$$pick any $x_1, y_1$ you prefer, and set $z_1$ as
$$z_1 = - \frac{\left (x_0 x_1 + y_0 y_1\right)}{ z_0}$$
That seems to be the simplest approach to get "random" branches.
If you want to control the length of the vector, then you can always normalize your obtained vector $\vec p$ and get the result vector $\vec r$ by using
$$
\vec r = len \times\frac{\vec p}{\left | \vec p\right| }
$$
where $len$ is the desired length of the vector.
If $z_0$ is $0$, then you'll get a singularity when you try to divide by $z_0$.
However, since $z_0$ is $0$, it does not impact the dot product at all, and therefore we can pick any $z_1$ we want to.
Solve for $y_1$ by picking some $x_1$, and then allowing $z_1$ to be "free" (that is, you can pick any $z_1 \in \mathbb{R}$). However, in doing so, you'll face a problem if $y_0$ is $0$ as well.
If both $z_0 = y_0 = 0$, then, you're forced to set $x_1 = 0$ (to maintain the dot product as $0$ for perpendicularity) while having $y_1, z_1 \in \mathbb{R}$ (that is, they are free).
Best Answer
If I understand you correctly, you are rotating the point $(x,y)$ by 180 degrees around the centre of the rectangle. If that centre is at $(a,b)$, the rotation takes $(x,y)$ to $(2a-x, 2b-y)$.