calculate aspect ratio in typescript

index.ts
function calculateAspectRatio(width: number, height: number): number {
    return width / height;
}

// Example usage
const width = 1920;
const height = 1080;
const aspectRatio = calculateAspectRatio(width, height);
console.log(aspectRatio); // Output: 1.7777777777777777
272 chars
10 lines

related categories

gistlibby LogSnag