DEGREES in JS
Last updated
Last updated
JavaScript does not provide a method to convert radians to degrees of a given angle. This could be calculated using the equation:
function degress(angle){
return (180/Math.PI) * angle;
}
angle
: Numeric expression in radians.
Same data type sent through parameter as a numeric expression.
CREATE OR REPLACE FUNCTION compute_degrees(angle float)
RETURNS float
LANGUAGE JAVASCRIPT
AS
$$
function degrees(angle){
return (180/Math.PI) * angle;
}
return degrees(ANGLE);
$$
;
SELECT COMPUTE_DEGREES(PI());