#include <iostream> #include <cmath> struct Vector3 { double x, y, z; }; double calculateYaw(Vector3 cameraPosition, Vector3 targetPosition) { double deltaX = targetPosition.x - cameraPosition.x; double deltaZ = targetPosition.z - cameraPosition.z; return atan2(deltaZ, deltaX); } int main() { Vector3 camera = {0.0, 0.0, 0.0}; Vector3 target = {1.0, 0.0, 1.0}; double yaw = calculateYaw(camera, target); std::cout << "Camera Yaw Angle = " << yaw << " radians" << std::endl; return 0; }