MCPcopy Create free account
hub / github.com/cartesiancs/map3d / project

Function project

src/three/Space.tsx:321–325  ·  view source on GitHub ↗
(lat: number, lng: number)

Source from the content-addressed store, hash-verified

319 const refLng = (area[1].lng + area[0].lng) / 2;
320
321 function project(lat: number, lng: number) {
322 const x = (lng - refLng) * scale * Math.cos((refLat * Math.PI) / 180);
323 const y = (lat - refLat) * scale;
324 return new THREE.Vector2(x, y);
325 }
326
327 useEffect(() => {
328 const south = area[1].lat;

Callers 2

RoadsFunction · 0.85
areaDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected