-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refractered the maths helper classes
- Loading branch information
Showing
9 changed files
with
23 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...va/frc/robot/utils/Math/AngleHelpers.java → ...va/frc/robot/utils/MapleMaths/Angles.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ava/frc/robot/utils/Math/BezierCurve.java → ...c/robot/utils/MapleMaths/BezierCurve.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package frc.robot.utils.MapleMaths; | ||
|
||
public class CommonMath { | ||
public static double linearInterpretationWithBounding(double x1, double y1, double x2, double y2, double x) { | ||
final double minX = Math.min(x1, x2), maxX = Math.max(x1, x2); | ||
return linearInterpretation(x1, y1, x2, y2, Math.min(maxX, Math.max(minX, x))); | ||
} | ||
public static double linearInterpretation(double x1, double y1, double x2, double y2, double x) { | ||
return y1 + (x - x1) * (y2 - y1) / (x2 - x1); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...ava/frc/robot/utils/Math/SpeedCurves.java → ...c/robot/utils/MapleMaths/SpeedCurves.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...c/robot/utils/Math/StatisticsHelpers.java → ...rc/robot/utils/MapleMaths/Statistics.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters