limelight pls marche

This commit is contained in:
2026-03-31 05:19:16 +02:00
parent 1240160ed7
commit 098f16665a
3 changed files with 97 additions and 58 deletions

View File

@@ -52,22 +52,28 @@ NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight-tag")
}
public double Calcule(double x1, double x2, double y1, double y2, double angle)
{
if(x1 > x2){
if(y1 > y2){
return Math.atan(90-((x2 - x1) / (y2 - y1))) * (180 / Math.PI) - angle;
// if(x1 > x2){
// if(y1 > y2){
// return Math.atan(90-((x2 - x1) / (y2 - y1))) * (180 / Math.PI) - angle;
// }
// else{
// return Math.atan((x2 - x1) / (y2 - y1)) * (180 / Math.PI)+90 - angle;
// }
// }
// else{
// if(y1 > y2){
// return Math.atan((x2 - x1) / (y2 - y1))* (180 / Math.PI)+270 - angle;
// }
// else{
// return Math.atan(90-((x2 - x1) / (y2 - y1))) * (180 / Math.PI)+180 - angle;
// }
// }
if(y1 > y2){
return Math.atan((x2 - x1) / (y2 - y1)) * (180 / Math.PI) - angle;
}
else{
return Math.atan((x2 - x1) / (y2 - y1)) * (180 / Math.PI)+90 - angle;
return Math.atan((x2 - x1) / (y2 - y1)) * (180 / Math.PI)-360 - angle;
}
}
else{
if(y1 > y2){
return Math.atan((x2 - x1) / (y2 - y1))* (180 / Math.PI)+270 - angle;
}
else{
return Math.atan(90-((x2 - x1) / (y2 - y1))) * (180 / Math.PI)+180 - angle;
}
}
}
@Override
public void periodic() {