Yaw and pitch calculation fix

This commit is contained in:
Omer
2019-09-22 22:28:05 +03:00
parent 07d0274753
commit 03459be291

View File

@@ -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));
}
}