Class Cartesian2d
java.lang.Object
frc.team_8840_lib.utils.math.units.Cartesian2d
A class to represent a 2d cartesian coordinate.
-
Constructor Summary
ConstructorsConstructorDescriptionCartesian2d(double r, edu.wpi.first.math.geometry.Rotation2d theta) Creates a new Cartesian2d -
Method Summary
Modifier and TypeMethodDescriptionadd(Cartesian2d other) Returns the angle in degreesstatic Cartesian2dfromTranslation2d(edu.wpi.first.math.geometry.Translation2d translation2d) Converts a Translation2d into a Cartesian2ddoublegetR()Returns the radiusedu.wpi.first.math.geometry.Rotation2dgetTheta()Returns the angleedu.wpi.first.math.geometry.Translation2dConverts class into a Translation2d
-
Constructor Details
-
Cartesian2d
public Cartesian2d(double r, edu.wpi.first.math.geometry.Rotation2d theta) Creates a new Cartesian2d- Parameters:
r- The radiustheta- 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
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
-