Esri/Leaflet : converting between pixel coordinates and latitude/longitude coordinates

I’m currently working on an interactive map using p5.js. Having said that, I’m on a mission to figure out how to communicate between a p5.js sketch and the leaflet map’s geographic coordinates, i.e., converting between pixel coordinates and latitude/longitude coordinates.

Is there anyone who can provide information or resources?

Would the following, from the Leaflet API Reference, be helpful?