Bounding Box Aspect Ratio
Calculate aspect ration from bounding box
🔧 Installation
npm i bbox-aspect-ratio
📦 Usage
import { bBoxAspectRatio, calculateSize, SizeType } from "bbox-aspect-ratio";
const topRight = [76.20742, 11.59426];
const bottomLeft = [76.86794, 11.95073];
const aspectRatio = bBoxAspectRatio([...topRight, ...bottomLeft]);
console.log(aspectRatio);
const sizeByWidth = calculateSize(aspectRatio, 50, SizeType.Width);
console.log(sizeByWidth);
const sizeByHeight = calculateSize(aspectRatio, 50, SizeType.Height);
console.log(sizeByWidth);