Here is my function

C++:

```
void CalcAngles(Vec source, Vec Destination, float angles[3]){
float delta[3] = { (source.x - Destination.x), (source.y - Destination.y), (source.z - Destination.z) };
float hyp = sqrt(delta[0] * delta[0] + delta[1] * delta[1]);
angles[0] = (float)(asinf(delta[2] / hyp) * 57.295779513082f);
float theta = (float)(atanf(delta[1] / delta[0]) * 57.295779513082f);//yaw in degrees
if (delta[0] >= 0.0) theta += 180.0f;
/*Code below is because I write to the rotation matrix (There is no yaw only values)*/
theta = theta * (M_PI / 180.0f) + aimbotOffset;//Deg->Rad
float vX = hyp * cos(theta);
float vY = hyp * sin(theta);
angles[1] = vX;
angles[2] = vY;
}
```