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.boolean
Get if a point is within the boundary of the circle.void
drawImpl()
Draw to AdvantageScope unconditionally.Get angle of a point with respect to the circle's center.Axis[]
getAxes()
Get theaxes
of thisConvexShape
.Get the center of thisConvexShape
.double
Get 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.double
sdf
(Translation2d pt) Get the signed distance of a point with respect to the circle.void
setCenter
(Translation2d center) Set the circle's centervoid
setRadius
(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:Drawable
Draw to AdvantageScope unconditionally. -
getAxes
Description copied from interface:ConvexShape
Get theaxes
of thisConvexShape
.- Specified by:
getAxes
in interfaceConvexShape
-
project
Description copied from interface:ConvexShape
- Specified by:
project
in interfaceConvexShape
-
getCenter
Description copied from interface:ConvexShape
Get the center of thisConvexShape
.- Specified by:
getCenter
in 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.
-