Package frc.lib.math
Class Circle
java.lang.Object
frc.lib.math.Circle
- All Implemented Interfaces:
ConvexShape,Drawable
Represents a circle with a known center and radius.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCircle(String name, Translation2d center, double radius) Represents a circle with a known center and radius. -
Method Summary
Modifier and TypeMethodDescriptionGet angles for points that are both tangent to the circle and colinear with a given point.booleanGet if a point is within the boundary of the circle.voiddrawImpl()Draw to AdvantageScope unconditionally.Get angle of a point with respect to the circle's center.Axis[]getAxes()Get theaxesof thisConvexShape.Get the center of thisConvexShape.doubleGet the circle's radiusgetVertex(Rotation2d rotation) Get point on the circle with a given angle.getVertex(Rotation2d rotation, double extra) Get point on the circle with a given angle and extra radius.doublesdf(Translation2d pt) Get the signed distance of a point with respect to the circle.voidsetCenter(Translation2d center) Set the circle's centervoidsetRadius(double radius) Set the circle's radius
-
Field Details
-
name
-
-
Constructor Details
-
Circle
Represents a circle with a known center and radius.
-
-
Method Details
-
drawImpl
public void drawImpl()Description copied from interface:DrawableDraw to AdvantageScope unconditionally. -
getAxes
Description copied from interface:ConvexShapeGet theaxesof thisConvexShape.- Specified by:
getAxesin interfaceConvexShape
-
project
Description copied from interface:ConvexShape- Specified by:
projectin interfaceConvexShape
-
getCenter
Description copied from interface:ConvexShapeGet the center of thisConvexShape.- Specified by:
getCenterin interfaceConvexShape
-
setCenter
Set the circle's center -
getRadius
public double getRadius()Get the circle's radius -
setRadius
public void setRadius(double radius) Set the circle's radius -
contains
Get if a point is within the boundary of the circle. -
sdf
Get the signed distance of a point with respect to the circle. -
getAngle
Get angle of a point with respect to the circle's center. -
getVertex
Get point on the circle with a given angle. -
getVertex
Get point on the circle with a given angle and extra radius. -
circleTangentAngles
Get angles for points that are both tangent to the circle and colinear with a given point.
-