#include#include "Vec3.h" int main() { Vec3 vec1(1, 2, 3); Vec3 vec2(4, 5, 6); Vec3 result = vec1 + vec2; std::cout << result.getX() << " " << result.getY() << " " << result.getZ() << std::endl; return 0; }
#includeThis code creates two Vec3 objects, and then calculates their dot product using the dot() method of the Vec3 class. The resulting scalar value is then printed to the console. Both examples use the Vec3 class from an external package library, which could be named "Vec3" or "Math" or similar.#include "Vec3.h" int main() { Vec3 vec1(1, 2, 3); Vec3 vec2(4, 5, 6); float result = vec1.dot(vec2); std::cout << result << std::endl; return 0; }