Package frc.lib.math
Class Axis
java.lang.Object
frc.lib.math.Axis
Represents an axis.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubledot(Translation2d point) Get the dot product between this direction and a given point.static AxisfromRotation(Rotation2d rot) Create an axis with the same direction as the given rotation.doublegetX()Get the X direction.doublegetY()Get the Y direction.project(Translation2d[] points) Project multiple points onto this axis.voidsetDirection(double xDir, double yDir) Set the direction.voidSet axis direction to the same direction as the given rotation.Get opposite direction.
-
Constructor Details
-
Axis
public Axis(double xDir, double yDir) Create new axis with a given direction. Either xDir or yDir must be non-zero.
-
-
Method Details
-
fromRotation
Create an axis with the same direction as the given rotation. -
setFromRotation
Set axis direction to the same direction as the given rotation. -
unaryMinus
Get opposite direction. Is equivalent as far as the definition of an axis is concerned, but for implementation purposes, has a negative direction. -
getX
public double getX()Get the X direction. -
getY
public double getY()Get the Y direction. -
setDirection
public void setDirection(double xDir, double yDir) Set the direction. Either xDir or yDir must be non-zero. -
dot
Get the dot product between this direction and a given point. -
project
Project multiple points onto this axis.
-