Class Cartesian2d

java.lang.Object
frc.team_8840_lib.utils.math.units.Cartesian2d

public class Cartesian2d extends Object
A class to represent a 2d cartesian coordinate.
  • Constructor Details

    • Cartesian2d

      public Cartesian2d(double r, edu.wpi.first.math.geometry.Rotation2d theta)
      Creates a new Cartesian2d
      Parameters:
      r - The radius
      theta - The angle
  • Method Details

    • getR

      public double getR()
      Returns the radius
      Returns:
      radius
    • getTheta

      public edu.wpi.first.math.geometry.Rotation2d getTheta()
      Returns the angle
      Returns:
      angle (Rotation2d)
    • add

      public Cartesian2d add(Cartesian2d other)
      Returns the angle in degrees
      Parameters:
      other -
      Returns:
    • toTranslation2d

      public edu.wpi.first.math.geometry.Translation2d toTranslation2d()
      Converts class into a Translation2d
      Returns:
      Translation2d
    • fromTranslation2d

      public static Cartesian2d fromTranslation2d(edu.wpi.first.math.geometry.Translation2d translation2d)
      Converts a Translation2d into a Cartesian2d
      Parameters:
      translation2d - The Translation2d to convert
      Returns:
      Cartesian2d