CircleArc2
public struct CircleArc2<Vector> : GeometricType, CustomStringConvertible where Vector : Vector2Real
extension CircleArc2: LineIntersectableType
extension CircleArc2: Equatable where Vector: Equatable
extension CircleArc2: Hashable where Vector: Hashable
Represents a 2D arc of a circle as a center, radius, and start+sweep angles.
-
Declaration
Swift
public typealias Scalar = Vector.Scalar
-
The center of the arc’s circle.
Declaration
Swift
public var center: Vector
-
The radius of the arc’s circle.
Declaration
Swift
public var radius: Scalar
-
Declaration
Swift
public var description: String { get }
-
Creates a new circular arc that fills the space between
startPoint
andendPoint
, with a sweep angle ofsweepAngle
. -
Creates a new circular arc that fits the given start/end points on the circumference of the arc, and a center point.
The sweep angle is chosen to be the shortest sweep angle that connects startAngle to endAngle.
Declaration
Swift
public init( center: Vector, startPoint: Vector, endPoint: Vector )
-
Creates a new circular arc that fits the given start/end points on the circumference of the arc, and a center point.
The sweep angle is chosen to be the clockwise sweep angle that connects startAngle to endAngle.
Declaration
Swift
public init( clockwiseAngleToCenter center: Vector, startPoint: Vector, endPoint: Vector )
-
Constructs a circle with the same center + radius as this circle arc.
Declaration
Swift
@inlinable var asCircle2: Circle2<Vector> { get }
-
Constructs an angle sweep from this arc’s start and sweep angles.
Declaration
Swift
@inlinable var asAngleSweep: AngleSweep<Scalar> { get }
-
Returns the stop angle of this sweep, as the sum of
startAngle
+sweepAngle
. -
Computes the area of this circular arc, when interpreted as a pie slice of a circle.
Declaration
Swift
@inlinable var area: Scalar { get }
-
Computes the length of this circular arc.
Declaration
Swift
@inlinable var arcLength: Scalar { get }
-
Returns the starting point on this arc.
Declaration
Swift
@inlinable var startPoint: Vector { get }
-
Returns the end point on this arc.
Declaration
Swift
@inlinable var endPoint: Vector { get }
-
Returns
true
if this circular arc contains a given angle in radians within its start + sweep region. -
Returns
true
if this circular arc contains a given angle value within its start + sweep region. -
Returns the result of an intersection test between this circular arc and a given line.
Declaration
Swift
func intersection<Line>( with line: Line ) -> PairLineIntersection<Vector> where Line: LineFloatingPoint, Vector == Line.Vector
-
Declaration
Swift
public func intersections<Line>( with line: Line ) -> LineIntersection<Vector> where Line: LineFloatingPoint, Vector == Line.Vector
-
Returns the minimal bounding box capable of fully containing this arc.
Declaration
Swift
func bounds() -> AABB<Vector>
-
Returns the coordinates of the occupied quadrants that this arc sweeps through.
The resulting array is up to four elements long, with each element representing an axis, from the arc’s center point, in the +/- x and +/- y direction, if the arc’s sweep includes that point.
Declaration
Swift
func quadrants() -> [Vector]
-
Projects a given point to the closest point within this arc.
Declaration
Swift
func project(_ point: Vector) -> Vector
-
Returns the squared distance to the closest point within this arc to the given point.
Declaration
Swift
func distanceSquared(to point: Vector) -> Scalar