limelight
This commit is contained in:
@@ -52,7 +52,22 @@ NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight-tag")
|
||||
}
|
||||
public double Calcule(double x1, double x2, double y1, double y2, double angle)
|
||||
{
|
||||
return Math.atan((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(90-((x2 - x1) / (y2 - y1)))* (180 / Math.PI)+270 - angle;
|
||||
}
|
||||
else{
|
||||
return Math.atan((x2 - x1) / (y2 - y1)) * (180 / Math.PI)+180 - angle;
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void periodic() {
|
||||
|
||||
Reference in New Issue
Block a user