Circle2
public extension Circle2
public extension Circle2 where Vector: VectorMultiplicative, Scalar: Comparable
extension Circle2: Convex2Type where Vector: Vector2FloatingPoint
public extension Circle2 where Vector: Vector2Real
-
Initializes a circle centered at a given point with a given radius.
Declaration
Swift
init(x: Scalar, y: Scalar, radius: Scalar)
-
Returns
true
if this circle’s area contains a given point.Points at the perimeter of the circle (distance to center == radius) are considered as contained within the circle.
Declaration
Swift
func contains(x: Scalar, y: Scalar) -> Bool
-
Returns the result of the intersection between
self
and anotherCircle2
.If the circles are coincident on the same center, and have the same radius, the result is
.noIntersection
.Declaration
Swift
public func intersection(with other: `Self`) -> ClosedShape2Intersection<Vector>
-
Returns a point on this circle represented by a given angle.
Declaration
Swift
@inlinable func pointOnAngle(_ angle: Angle<Scalar>) -> Vector
-
Generates an arc from this circle.
Declaration
Swift
func arc(startAngle: Angle<Scalar>, sweepAngle: Angle<Scalar>) -> CircleArc2<Vector>
-
Generates an arc from this circle.
Declaration
Swift
func arc(startAngle: Scalar, sweepAngle: Scalar) -> CircleArc2<Vector>
-
Computes the two points that are touching the tangents of this circie starting from
point
.Precondition
point
is at leastradius
-distance away fromself.center
.Declaration
Swift
func tangents(to point: Vector) -> (Vector, Vector)
-
Computes the outer tangents between circles
self
andother
, returning the two tangent lines.The two tangents are ordered as the top and bottom, respectively, of a setup where
self
is aligned exactly to the left ofother
, with both tangents pointing fromself
toother
.Declaration
Swift
func outerTangents(to other: `Self`) -> (LineSegment2<Vector>, LineSegment2<Vector>)