mirror of
https://github.com/Team4388/2022NoWayHome.git
synced 2026-06-09 08:48:07 -06:00
vector2d angle
This commit is contained in:
@@ -79,6 +79,7 @@ import frc4388.robot.subsystems.VisionOdometry;
|
||||
import frc4388.utility.LEDPatterns;
|
||||
import frc4388.utility.ListeningSendableChooser;
|
||||
import frc4388.utility.PathPlannerUtil;
|
||||
import frc4388.utility.Vector2D;
|
||||
import frc4388.utility.PathPlannerUtil.Path.Waypoint;
|
||||
import frc4388.utility.controller.DeadbandedXboxController;
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
package frc4388.utility;
|
||||
|
||||
import edu.wpi.first.math.geometry.Translation2d;
|
||||
import edu.wpi.first.wpilibj.drive.Vector2d;
|
||||
|
||||
/** Aarav's good vector class (better than WPILib) */
|
||||
@@ -11,9 +12,11 @@ public class Vector2D extends Vector2d {
|
||||
|
||||
public double x;
|
||||
public double y;
|
||||
public double angle;
|
||||
|
||||
public Vector2D() {
|
||||
super();
|
||||
this.angle = Math.atan2(this.y, this.x);
|
||||
}
|
||||
|
||||
public Vector2D(double x, double y) {
|
||||
@@ -21,6 +24,7 @@ public class Vector2D extends Vector2d {
|
||||
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.angle = Math.atan2(this.y, this.x);
|
||||
}
|
||||
|
||||
public static Vector2D add(Vector2D v1, Vector2D v2) {
|
||||
|
||||
Reference in New Issue
Block a user