Add Horizontal to vertical FOV convert and vice versa

This commit is contained in:
2026-02-22 11:22:48 +01:00
parent a71894d0ad
commit 989ee470df
2 changed files with 13 additions and 1 deletions

View File

@@ -7,11 +7,19 @@
#include "Maths.hpp"
#include <cmath>
float Maths::FOVHToV(float fovH, float aspect) {
return 2.0f * std::atan(std::tan(fovH * 0.5f * (M_PI / 180.0f)) / aspect) * (180.0f / M_PI);
}
float Maths::FOVVToH(float fovV, float aspect) {
return 2.0f * std::atan(std::tan(fovV * 0.5f * (M_PI / 180.0f)) * aspect) * (180.0f / M_PI);
}
double Maths::DegreesToRadians(double degrees) {
return degrees * M_PI / 180.0;
}
// Convertit des radians en degrés
// Converts radians in degree
double Maths::RadiansToDegrees(double radians) {
return radians * 180.0 / M_PI;
}