Arc

An Arc is a portion of the circumference of a circle.

Constructor

new Arc(center, radius, start_angle, end_angle)

Creates a new Arc object from a center point, radius, start angle, and end angle.

Parameters:
NameTypeDescription
centerPoint2D

The center point of the arc as a Point2D.

radiusnumber

The radius of the arc.

start_anglenumber

The start angle of the arc in radians.

end_anglenumber

The end angle of the arc in radians.

Classes

Arc

Members

center

Returns the center point of the arc.

end_angle

Returns the end angle of the arc in radians.

radius

Returns the radius of the arc.

start_angle

Returns the start angle of the arc in radians.

Methods

both_tips_vector_object_builder(tip_shape, samplesopt) → {VectorObjectBuilder}

Returns a VectorObjectBuilder representing the arc and tips at both ends of the arc.

Parameters:
NameTypeAttributesDescription
tip_shapeVectorObjectBuilder

The tip shape as a VectorObjectBuilder to add to the start of the arc. It must be pointing to the right and centered at (0, 0). This function will rotate and move it to the correct angle.

samplesnumber | null<optional>

The number of samples to use to create the arc.

Returns:

A VectorObjectBuilder representing the arc and tips at both ends of the arc.

Type: 
VectorObjectBuilder

end_tip_vector_object_builder(tip_shape, samplesopt) → {VectorObjectBuilder}

Returns a VectorObjectBuilder representing the arc and a tip at the end of the arc.

Parameters:
NameTypeAttributesDescription
tip_shapeVectorObjectBuilder

The tip shape as a VectorObjectBuilder to add to the end of the arc. It must be pointing to the right and centered at (0, 0). This function will rotate and move it to the correct angle.

samplesnumber | null<optional>

The number of samples to use to create the arc.

Returns:

A VectorObjectBuilder representing the arc and a tip at the end of the arc.

Type: 
VectorObjectBuilder

length() → {number}

Returns the length of the arc.

Returns:

The length of the arc.

Type: 
number

point_at(t) → {Point2D}

Returns the point on the arc at a given t progress value.

Parameters:
NameTypeDescription
tnumber

The t value to evaluate the polynomial at. A number between 0 and 1.

Returns:

The Point2D on the arc at the given t value.

Type: 
Point2D

start_tip_vector_object_builder(tip_shape, samplesopt) → {VectorObjectBuilder}

Returns a VectorObjectBuilder representing the arc and a tip at the start of the arc.

Parameters:
NameTypeAttributesDescription
tip_shapeVectorObjectBuilder

The tip shape as a VectorObjectBuilder to add to the start of the arc. It must be pointing to the right and centered at (0, 0). This function will rotate and move it to the correct angle.

samplesnumber | null<optional>

The number of samples to use to create the arc, by default 15.

Returns:

A VectorObjectBuilder representing the arc and a tip at the start of the arc.

Type: 
VectorObjectBuilder

vector_object_builder(samplesopt) → {VectorObjectBuilder}

Creates a new vector object builder with the arc's points.

Parameters:
NameTypeAttributesDescription
samplesnumber | null<optional>
Returns:

A VectorObjectBuilder representing the arc.

Type: 
VectorObjectBuilder