-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from ThePinkAlliance/2k23
- Loading branch information
Showing
10 changed files
with
89 additions
and
100 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
6 changes: 0 additions & 6 deletions
6
src/main/java/com/ThePinkAlliance/core/annotations/Untested.java
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
src/main/java/com/ThePinkAlliance/core/ctre/fx/TalonFXUtils.java
This file was deleted.
Oops, something went wrong.
52 changes: 0 additions & 52 deletions
52
src/main/java/com/ThePinkAlliance/core/ctre/fx/commands/TalonFX_HardStopHoming.java
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
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,75 @@ | ||
package com.ThePinkAlliance.core.math; | ||
|
||
import java.util.Objects; | ||
|
||
/** | ||
* A vector in 2-dimensional Cartesian space. | ||
*/ | ||
public class Vector2d { | ||
public final double x; | ||
public final double y; | ||
|
||
/** | ||
* Creates a vector from the origin to the point <code>(x, y)</code>. | ||
* | ||
* @param x the X-coordinate of the vector | ||
* @param y the Y-coordinate of the vector | ||
*/ | ||
public Vector2d(double x, double y) { | ||
this.x = x; | ||
this.y = y; | ||
} | ||
|
||
/** | ||
* Gets the X-coordinate of this vector. | ||
*/ | ||
public double getX() { | ||
return x; | ||
} | ||
|
||
/** | ||
* Gets the Y-coordinate of this vector. | ||
*/ | ||
public double getY() { | ||
return y; | ||
} | ||
|
||
/** | ||
* Gets the magnitude of this vector. | ||
*/ | ||
public double getMagnitude() { | ||
return Math.sqrt(x * x + y * y); | ||
} | ||
|
||
/** | ||
* Gets the angle of this vector, in radians in the range | ||
* <code>(-pi, pi)</code>. | ||
*/ | ||
public double getAngle() { | ||
return Math.atan2(y, x); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
Vector2d that = (Vector2d) o; | ||
return this.x == that.x | ||
&& this.y == that.y; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(x, y); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Vector2d(" + x + "," + y + ")"; | ||
} | ||
|
||
} |
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