Package frc.lib.math

Class RotationInterval

java.lang.Object
frc.lib.math.RotationInterval

public class RotationInterval extends Object
A one-dimensional range with wrapping on [-pi,pi].
  • Constructor Details

    • RotationInterval

      public RotationInterval(Rotation2d min, Rotation2d max)
      A one-dimensional range with wrapping on [-pi,pi].
  • Method Details

    • acute

      public static RotationInterval acute(Rotation2d a, Rotation2d b)
      A one-dimensional range with wrapping on [-pi,pi].
    • complement

      public RotationInterval complement()
      Get the interval opposite this.
    • range

      public double range()
      Get distance from min to max.
    • getMin

      public Rotation2d getMin()
      Get lower extent of the range.
    • setMin

      public void setMin(Rotation2d min)
      Set lower extent of the range.
    • getMax

      public Rotation2d getMax()
      Get upper extent of the range.
    • setMax

      public void setMax(Rotation2d max)
      Set upper extent of the range.
    • overlaps

      public boolean overlaps(RotationInterval other)
      Get if two intervals share some angles.
    • getOverlap

      public double getOverlap(RotationInterval other)
      Get length of common subset.