mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-20 00:51:41 +00:00
Yaw and pitch calculation fix
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user