Low Precision Moon Position

Algorithm from Astronomical Almanac D22. Accurate to about .5deg over the period 1900 - 2100.
Compute Geocentric RA/DEC of moon.
JD:
RA: Hours
DEC: Degrees

const torad=Math.PI/180.0;

function sind(r){
	return Math.sin(r*torad);
}

function cosd(r){
	return Math.cos(r*torad);
}

//Low precision geocentric moon position (RA,DEC) from Astronomical Almanac page D22 (2017 ed)
function getGeocentricMoonPos(jd){
	let T = (jd-2451545)/36525;
	let L = 218.32 + 481267.881*T + 6.29*sind(135.0 + 477198.87*T) - 1.27*sind(259.3 - 413335.36*T) + 0.66*sind(235.7 + 890534.22*T) + 0.21*sind(269.9 + 954397.74*T) - 0.19*sind(357.5 + 35999.05*T) - 0.11*sind(186.5 + 966404.03*T);
	let B = 5.13*sind( 93.3 + 483202.02*T) + 0.28*sind(228.2 + 960400.89*T) - 0.28*sind(318.3 + 6003.15*T) - 0.17*sind(217.6 - 407332.21*T);
	let P = 0.9508 + 0.0518*cosd(135.0 + 477198.87*T) + 0.0095*cosd(259.3 - 413335.36*T) + 0.0078*cosd(235.7 + 890534.22*T) + 0.0028*cosd(269.9 + 954397.74*T);

	let SD=0.2724*P;
	let r=1/sind(P);

	let l = cosd(B) * cosd(L);
	let m = 0.9175*cosd(B)*sind(L) - 0.3978*sind(B);
	let n = 0.3978*cosd(B)*sind(L) + 0.9175*sind(B);

	let ra=Math.atan2(m,l)/torad;
	if(ra<0){ra+=360;}
	ra/=15.0;
	let dec=Math.asin(n)/torad;
	return [ra,dec];
}