mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-18 01:02:23 +00:00
Keep fire normalization, LOD, anchors, cards and selection portable while the native renderer owns ground cells, sprites, input and scene disposal. Cancel superseded/removed settle timers and unregister the original sprite collection. Preserve all ten native raster pairs exactly in dev and preview; record source/click/focus/lifecycle, legacy Metal and full regression evidence with strict comparator sensitivity checks.
28 lines
855 B
JavaScript
28 lines
855 B
JavaScript
import * as geo from '../../geo/index.js';
|
|
|
|
// The small rectangle operations used by FIRMS, on plain radian bounds.
|
|
export function rectangleWidth(rectangle) {
|
|
let east = rectangle.east;
|
|
if (east < rectangle.west) east += geo.math.TWO_PI;
|
|
return east - rectangle.west;
|
|
}
|
|
export function rectangleHeight(rectangle) {
|
|
return rectangle.north - rectangle.south;
|
|
}
|
|
export function rectangleCenter(rectangle, result) {
|
|
let east = rectangle.east;
|
|
if (east < rectangle.west) east += geo.math.TWO_PI;
|
|
result.longitude = geo.math.negativePiToPi((rectangle.west + east) * 0.5);
|
|
result.latitude = (rectangle.south + rectangle.north) * 0.5;
|
|
result.height = 0;
|
|
return result;
|
|
}
|
|
export function cloneRectangle(rectangle) {
|
|
return {
|
|
west: rectangle.west,
|
|
south: rectangle.south,
|
|
east: rectangle.east,
|
|
north: rectangle.north,
|
|
};
|
|
}
|