Updated to 2024.4.8.8

This commit is contained in:
thenetworkgrinch
2024-06-13 17:10:51 -05:00
parent d308949806
commit 073ba711e0
112 changed files with 611 additions and 411 deletions

View File

@@ -410,4 +410,27 @@ public class SwerveMath
moduleState.angle = lastModuleState.angle;
}
}
/**
* Cube the {@link Translation2d} magnitude given in Polar coordinates.
*
* @param translation {@link Translation2d} to manipulate.
* @return Cubed magnitude from {@link Translation2d}.
*/
public static Translation2d cubeTranslation(Translation2d translation)
{
return new Translation2d(Math.pow(translation.getNorm(), 3), translation.getAngle());
}
/**
* Scale the {@link Translation2d} Polar coordinate magnitude.
*
* @param translation {@link Translation2d} to use.
* @param scalar Multiplier for the Polar coordinate magnitude to use.
* @return {@link Translation2d} scaled by given magnitude scalar.
*/
public static Translation2d scaleTranslation(Translation2d translation, double scalar)
{
return new Translation2d(translation.getNorm() * scalar, translation.getAngle());
}
}