Skip to content
This repository was archived by the owner on Sep 14, 2019. It is now read-only.

Commit f8c3503

Browse files
committed
modify atan to atan2
1 parent 5b6d7c6 commit f8c3503

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • Robot2018/src/org/usfirst/frc/team199/Robot2018/commands

Robot2018/src/org/usfirst/frc/team199/Robot2018/commands/PIDTurn.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public PIDTurn(double[] point, DrivetrainInterface dt, SmartDashboardInterface s
115115
double dx = point[0] - AutoUtils.position.getX();
116116
double dy = point[1] - AutoUtils.position.getY();
117117

118-
double absTurn = Math.toDegrees(Math.atan(dx / dy));
118+
double absTurn = Math.toDegrees(Math.atan2(dx, dy));
119119
target = absTurn - AutoUtils.position.getRot();
120120

121121
if (Robot.dt != null) {

0 commit comments

Comments
 (0)