Package com.pathplanner.lib.util
Class GeometryUtil
java.lang.Object
com.pathplanner.lib.util.GeometryUtil
Utility class for various geometry functions used during generation
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
Calculate the curve radius given 3 points on the curvestatic Translation2d
cubicLerp
(Translation2d a, Translation2d b, Translation2d c, Translation2d d, double t) Cubic interpolation between Translation2dsstatic Translation2d
quadraticLerp
(Translation2d a, Translation2d b, Translation2d c, double t) Quadratic interpolation between Translation2ds
-
Constructor Details
-
GeometryUtil
public GeometryUtil()
-
-
Method Details
-
quadraticLerp
public static Translation2d quadraticLerp(Translation2d a, Translation2d b, Translation2d c, double t) Quadratic interpolation between Translation2ds- Parameters:
a
- Position 1b
- Position 2c
- Position 3t
- Interpolation factor (0.0-1.0)- Returns:
- Interpolated value
-
cubicLerp
public static Translation2d cubicLerp(Translation2d a, Translation2d b, Translation2d c, Translation2d d, double t) Cubic interpolation between Translation2ds- Parameters:
a
- Position 1b
- Position 2c
- Position 3d
- Position 4t
- Interpolation factor (0.0-1.0)- Returns:
- Interpolated value
-
calculateRadius
Calculate the curve radius given 3 points on the curve- Parameters:
a
- Point Ab
- Point Bc
- Point C- Returns:
- Curve radius
-