Class: DefArc

algeobra~DefArc(params, ropt, centeropt, startAngleopt, endAngleopt)

Definition of an arc

Constructor

new DefArc(params, ropt, centeropt, startAngleopt, endAngleopt)

Default values
Parameters:
Name Type Attributes Default Description
params Object
r Number <optional>
1 The radius
center Object <optional>
{x:0,y:0} The center
startAngle Number <optional>
0 The starting angle
endAngle Number <optional>
2.0 * Math.PI The end angle
Source:

Methods

compute(createInfo) → {Object}

Compute the arc
Parameters:
Name Type Description
createInfo CreateInfo The creation info
Source:
Returns:
The arc of type TYPE_ARC
Type
Object

(static) computeParametersFromPoints(p0, p1, p2, fullCircle) → {Object|null}

Create an arc from three points
Parameters:
Name Type Description
p0 Object The first point
p1 Object The second point
p2 Object The third point
fullCircle Boolean If true, the resulting arc will be a circle, otherwise the arc will only be the range specified by the points
Source:
Returns:
The computed arc or null, if no such arc can exist
Type
Object | null

(static) fromCenterAndPoints(center, p0, p1) → {CreateInfo}

Create an arc from a center and going through the segment specified by two points on the circle
Parameters:
Name Type Description
center Number | Object Either the index or value of a TYPE_POINT. The center
p0 Number | Object Either the index or value of a TYPE_POINT. The first point
p1 Number | Object Either the index or value of a TYPE_POINT. The second point
Source:
Returns:
The creation info
Type
CreateInfo

(static) fromPoints(params) → {CreateInfo}

Create an arc from three points
Parameters:
Name Type Description
params Object
Properties
Name Type Attributes Description
p0 Number | Object Either the index or value of a TYPE_POINT. The first point
p10 Number | Object Either the index or value of a TYPE_POINT. The second point
p2 Number | Object Either the index or value of a TYPE_POINT. The third point
fullCircle Boolean <optional>
If true, the resulting arc will be a circle, otherwise the arc will only be the range specified by the points
Source:
Returns:
The creation info
Type
CreateInfo

(static) fromValues(params) → {CreateInfo}

Create an arc from individual values
Parameters:
Name Type Description
params Object
Properties
Name Type Attributes Description
r Number | Object <optional>
Either the index or value of a TYPE_NUMBER. The radius
center Number | Object <optional>
Either the index or value of a TYPE_POINT. The center
startAngle Number | Object <optional>
Either the index or value of a TYPE_NUMBER. The starting angle
endAngle Number | Object <optional>
Either the index or value of a TYPE_NUMBER. The end angle
Source:
Returns:
The creation info
Type
CreateInfo