mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Use standard constant for pi instead of 3.14 (#2084)
This commit is contained in:
committed by
Peter Johnson
parent
db2c3dddd7
commit
1b66ead49d
@@ -30,7 +30,7 @@ public class Robot extends TimedRobot {
|
||||
|
||||
@Override
|
||||
public void robotInit() {
|
||||
m_encoder.setDistancePerPulse(1.0 / 360.0 * 2.0 * 3.1415 * 1.5);
|
||||
m_encoder.setDistancePerPulse(1.0 / 360.0 * 2.0 * Math.PI * 1.5);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -29,7 +29,7 @@ public class Robot extends TimedRobot {
|
||||
|
||||
@Override
|
||||
public void robotInit() {
|
||||
m_encoder.setDistancePerPulse(1.0 / 360.0 * 2.0 * 3.1415 * 1.5);
|
||||
m_encoder.setDistancePerPulse(1.0 / 360.0 * 2.0 * Math.PI * 1.5);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -54,7 +54,7 @@ public class Robot extends TimedRobot {
|
||||
* attached to a 3 inch diameter (1.5inch radius) wheel,
|
||||
* and that we want to measure distance in inches.
|
||||
*/
|
||||
m_encoder.setDistancePerPulse(1.0 / 360.0 * 2.0 * 3.1415 * 1.5);
|
||||
m_encoder.setDistancePerPulse(1.0 / 360.0 * 2.0 * Math.PI * 1.5);
|
||||
|
||||
/*
|
||||
* Defines the lowest rate at which the encoder will
|
||||
|
||||
Reference in New Issue
Block a user