mirror of
https://github.com/BroncBotz3481/YAGSL
synced 2026-06-19 06:21:40 +00:00
Updated to 2024.4.8.8
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user