I glanced at it but didn't really find any issue, so now I'm confused by your new formula 
Did you mean to write COS in the second line? It made more sense for the Y coordinate to be = radius * sin(angle), where "angle" is the total angle, in radians, relatively to the global X-axis and "radius" is the distance to the known point. There might be an issue in the way you compute the P1-P2 line angle relatively to the X-axis?
I made a little drawing:

I'm assuming you are tracking P1 and P2 and you are looking for P3. And assuming you know about alpha2 (blue) (the P2-P1-P3 angle) that you measure by hand on the object, and you also know d, the distance between P1 and P3, measured on the object.
So what you are doing is, find alpha1, then compute alpha3, compute the P1-P3 vector from trigonometry, and add that vector to P1. Correct?
Your original formula should work:
P3x = P1x + d * cos(alpha3)
P3y = P1y + d * sin(alpha3)
How do you compute alpha1?
There is another way that doesn't involve angles, if you express P3 in its own little coordinate system where P1-P2 is the horizontal unit vector.