Trying to plot a point on a map with Albers projection using the given latitude and longitude coordinates, but encountering issues. The map is built with the Albers projection using standard parallels at 52 and 64 degrees with WGS 84. I attempted to implement the formulas for Albers projection in Javascript, but the results are incorrect. Seeking guidance as existing similar questions online did not provide relevant answers for my specific scenario.
// lat and long of left top corner
f0 = 66 * (Math.PI/180);
a0 = 36 * (Math.PI/180);
// lat and long of my point
f = 55 * (Math.PI/180);
a = 37 * (Math.PI/180);
// Standart parallers
f1 = 52 * (Math.PI/180);
f2 = 64 * (Math.PI/180);
n = 1/2 * (Math.sin(f1)+Math.sin(f2));
c = Math.pow(Math.cos(f1),2) + 2*n*Math.sin(f1);
t = n*(a*(180/Math.PI) - a0*(180/Math.PI))* (Math.PI/180);
p0 = 1/n * Math.sqrt(c-2*n*Math.sin(f0));
p=1/n*Math.sqrt(c-2*n*Math.sin(f));
x=p*Math.sin(t);
y=p0-p*Math.cos(t);
Any assistance would be greatly appreciated. Thank you.