Members
(static) degFactor
- Source:
The factor to convert radians to degrees.
(static) radFactor
- Source:
The factor to convert degrees to radians.
(static) twoPI
- Source:
Two times PI.
Methods
(static) apothem(r, n) → {Number}
- Source:
Returns the apothem of a regular n-sided polygon based on its radius.
Parameters:
Name | Type | Description |
---|---|---|
r |
Number | The radius. |
n |
Number | The number of edges of the regular polygon. |
Returns:
The apothem of a n-sided polygon based on its radius.
- Type
- Number
(static) centralAngle(n) → {Number}
- Source:
The central angle of a n-sided regular polygon. In radians.
Parameters:
Name | Type | Description |
---|---|---|
n |
Number | The number of sides of the regular polygon. |
Returns:
The central angle of the n-sided polygon in radians.
- Type
- Number
(static) innerAngle(n) → {Number}
- Source:
Returns the inner angle of a n-sided regular polygon.
Parameters:
Name | Type | Description |
---|---|---|
n |
Number | Number of sides of a regular polygon. |
Returns:
The inner angle of a given regular polygon.
- Type
- Number
(static) meanAngle(arr) → {Number}
- Source:
Returns the means of the angles contained in an array. In radians.
Parameters:
Name | Type | Description |
---|---|---|
arr |
Array.<Number> | An array containing angles (in radians). |
Returns:
The mean angle in radians.
- Type
- Number
(static) parityOfPermutation(arr) → {Number}
- Source:
Returns the parity of the permutation (1 or -1)
Parameters:
Name | Type | Description |
---|---|---|
arr |
Array | An array containing the permutation. |
Returns:
The parity of the permutation (1 or -1), where 1 means even and -1 means odd.
- Type
- Number
(static) polyCircumradius(s, n) → {Number}
- Source:
Returns the circumradius of a n-sided regular polygon with a given side-length.
Parameters:
Name | Type | Description |
---|---|---|
s |
Number | The side length of the regular polygon. |
n |
Number | The number of sides. |
Returns:
The circumradius of the regular polygon.
- Type
- Number
(static) round(value, decimals) → {Number}
- Source:
Rounds a value to a given number of decimals.
Parameters:
Name | Type | Description |
---|---|---|
value |
Number | A number. |
decimals |
Number | The number of decimals. |
Returns:
A number rounded to a given number of decimals.
- Type
- Number
(static) toDeg(rad) → {Number}
- Source:
Convertes radians to degrees.
Parameters:
Name | Type | Description |
---|---|---|
rad |
Number | An angle in radians. |
Returns:
The angle in degrees.
- Type
- Number
(static) toRad(deg) → {Number}
- Source:
Converts degrees to radians.
Parameters:
Name | Type | Description |
---|---|---|
deg |
Number | An angle in degrees. |
Returns:
The angle in radians.
- Type
- Number