MathUtils
NAME
VERSION
SYNOPSIS
EXPORT
* /dms($x)
* /hms($x)
SUBROUTINES
frac($x)
frac360($x)
dms($x)
Positional arguments:
* decimal value, 0..360 for angular mode, 0..24 for time
Named arguments:
* places (optional) amount of required sexagesimal values to be returned (1-3); default = 3 (degrees/hours, minutes, seconds)
Returns:
* array of degrees (int), minutes (int), seconds (float)
hms($x)
zdms($x)
Positional arguments:
* decimal value, 0..360 for angular mode, 0..24 for time
Returns:
* array of zodiac sign (0-11), degrees (int), minutes (int), seconds (float)
ddd($deg[, $min[, $sec]])
Arguments
*
ddd(11)
*
ddd(11, 46)
*
ddd(11, 46, 20)
*
ddd(-11, 46, 0) = -11.766666666666667
*
ddd(11, -46, 0) = 11.766666666666667
Returns:
* decimal (degrees or hours)
polynome($t, @terms)
Arguments
* $t coefficient, in astronomical routines usually time in centuries
* any number of decimal values
Returns:
* decimal number
to_range($x, $range)
Arguments
* number to reduce
* limit (non-inclusive), e.g: 360 for degrees, 24 for hours
Returns
* number
reduce_deg($x)
reduce_rad($x)
opposite_deg($x)
opposite_rad($x)
angle_c($x, $y)
angle_c_rad($x, $y)
angle_s($x1, $y1, $x2, $y2)
diff_angle($a, $b, $mode='degrees')
Positional Arguments
* $a first angle, in radians or degrees
* $b second angle, in radians or degrees
Named Arguments
* $mode
"degrees"
(default) or"radians"
, case insensitive.
sine($x)
cart($r, $theta, $phi)
Arguments
* $r, distance from the origin;
* $theta (in radians) corresponding to [-90 deg, +90 deg];
* $phi (in radians) corresponding to [-360 deg, +360 deg])
Returns
* $x, X
* $y, Y
* $z, Z
polar($x, $y, $z)
Arguments
* $x, X
* $y, Y
* $z, Z
Returns
* $r, distance from the origin;
* $theta (in radians) corresponding to [-90 deg, +90 deg];
* $phi (in radians) corresponding to [-360 deg, +360 deg])
quad($y_minus, $y_0, $y_plus)
Arguments
* $y_minus value of function at x = -1
* $y_0 value of function at x = 0
* $y_plus value of function at x = 1
Returns
* $xe, abscissa of extremum (may be outside
[-1, 1]
)
* $ye, Value of function at xe
* $root1, first root found
* $root2, second root found
* $n_root, number of roots within the interval
[-1, +1]