You need to find the rotation matrix in 2 dimensions. See:

Rotation matrix - Wikipedia, the free encyclopedia

for details. All you need is the equation for x' and y' in the section "Dimension 2".

To find the values of cos(theta) and sin(theta), just substitute x for cos(theta) and sqrt(1-x^2) for sin(theta). Then use algebra to force the y component of point A to be zero.