Hey I used Suncalc and to display result on my map I need to convert azimuth and altitude to a lat and long geocode.
https://github.com/mourner/suncalc
I want a geocode for an sunrise and sunset Azimuth. Goal : display sunrise and sunset direction to help photographer to shoot in nice context.
Unfornutualy after lot of searches I don't find any solution...
const SunCalc = require('suncalc');
const times = SunCalc.getTimes(new Date(), 51.5, -0.1);
const sunrisePos = SunCalc.getPosition(times.sunrise, 51.5, -0.1);
//=> return {altitude: -0.01289938147213956, azimuth: -2.2320632810606815}
const sunsetPos = SunCalc.getPosition(times.sunset, 51.5, -0.1);
//=> return {altitude: -0.015978167093788746, azimuth: 2.2402224959763553}
const sunriseAzimuth = sunrisePos.azimuth * 180 / Math.PI;
//=> return -127.88780561089992
const sunsetAzimuth = sunsetPos.azimuth * 180 / Math.PI;
//=> return 128.35529418970822
I want to use thoses GEOCODE (lat and long) in my leaflet map with a polyline.