From 03459be291827ad227c427a8ce3aff0a67acf7ce Mon Sep 17 00:00:00 2001 From: Omer Date: Sun, 22 Sep 2019 22:28:05 +0300 Subject: [PATCH] Yaw and pitch calculation fix --- .../java/com/chameleonvision/vision/camera/CameraValues.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Main/src/main/java/com/chameleonvision/vision/camera/CameraValues.java b/Main/src/main/java/com/chameleonvision/vision/camera/CameraValues.java index d9b0dc0e0..0ea7e8873 100644 --- a/Main/src/main/java/com/chameleonvision/vision/camera/CameraValues.java +++ b/Main/src/main/java/com/chameleonvision/vision/camera/CameraValues.java @@ -41,10 +41,10 @@ public class CameraValues { VerticalFocalLength = ImageHeight / (2 * FastMath.tan(VerticalView /2)); } public double CalculatePitch(double PixelY, double centerY){ - double pitch = (FastMath.toDegrees((FastMath.atan(PixelY - centerY) / VerticalFocalLength))); + double pitch = FastMath.toDegrees(FastMath.atan((PixelY - centerY) / VerticalFocalLength)); return (pitch * -1); } public double CalculateYaw(double PixelX, double centerX){ - return FastMath.toDegrees(FastMath.atan(PixelX - centerX) / HorizontalFocalLength); + return FastMath.toDegrees(FastMath.atan((PixelX - centerX) / HorizontalFocalLength)); } }