How do I rotate a line segment in a specific point on the line? If I have two points $A$ and $B$, which $AB$ is a line segment, how can I rotate the $AB$ in another Point $C$ which is a point on the line $AB$. 
Thank you in advance.

Using complex numbers:
In the complex, multiplying by $e^{i\theta}$ amounts to a rotation around the origin by the angle $\theta$. To rotate around another point, translate so that the center moves to the origin, rotate and translate back.
Hence, for any point $a$ in the plane
$$a'=(a-c)e^{i\theta}+c.$$
This expands as
$$a'_x=(a_x-c_x)\cos\theta-(a_y-c_y)\sin\theta+c_x,\\
a'_y=(a_x-c_x)\sin\theta+(a_y-c_y)\cos\theta+c_y.
$$
