Your example is a little vague, but it looks like you have a line with endpoints (x1, y1) and (x0, y0) and you want to rotate it by angle, so that its endpoints are now (newx1, newy1) and (x0, y0).
If this is the case, what you need to do is determine the length of the line using the...