Calculators

Geometry Calculator

Geometry Calculator

Geometry Calculator

Calculate area, perimeter, volume, and other properties of geometric shapes

Square
Rectangle
Triangle
Circle
Sphere
Cylinder
Cone
Cube
◼️

Square Formulas

Area = a²
Perimeter = 4a
Diagonal = a√2
▭

Rectangle Formulas

Area = l × w
Perimeter = 2(l + w)
Diagonal = √(l² + w²)
▲

Triangle Formulas

Area = ½ × b × h
Perimeter = a + b + c
●

Circle Formulas

Area = πr²
Circumference = 2πr
Diameter = 2r
🔴

Sphere Formulas

Volume = (4/3)πr³
Surface Area = 4πr²
⛽

Cylinder Formulas

Volume = πr²h
Surface Area = 2πr(h + r)
🔺

Cone Formulas

Volume = (1/3)πr²h
Slant Height = √(r² + h²)
Surface Area = πr(r + √(r² + h²))
⬛

Cube Formulas

Volume = a³
Surface Area = 6a²
Space Diagonal = a√3
Calculation Results
${area.toFixed(4)}
Perimeter
${perimeter.toFixed(4)}
Diagonal
${diagonal.toFixed(4)}
Side Length
${side.toFixed(4)}
`; showResult('Square Properties', resultHTML); } // Rectangle calculations function calculateRectangle() { const length = parseFloat(document.getElementById('rectangle-length').value); const width = parseFloat(document.getElementById('rectangle-width').value); if (!length || length <= 0 || !width || width <= 0) { showError('Please enter valid positive numbers for length and width.'); return; } const area = length * width; const perimeter = 2 * (length + width); const diagonal = Math.sqrt(length * length + width * width); const resultHTML = `
Area
${area.toFixed(4)}
Perimeter
${perimeter.toFixed(4)}
Diagonal
${diagonal.toFixed(4)}
Length
${length.toFixed(4)}
Width
${width.toFixed(4)}
`; showResult('Rectangle Properties', resultHTML); } // Triangle calculations function calculateTriangle() { const base = parseFloat(document.getElementById('triangle-base').value); const height = parseFloat(document.getElementById('triangle-height').value); const side1 = parseFloat(document.getElementById('triangle-side1').value); const side2 = parseFloat(document.getElementById('triangle-side2').value); if (!base || base <= 0 || !height || height <= 0 || !side1 || side1 <= 0 || !side2 || side2 <= 0) { showError('Please enter valid positive numbers for all triangle dimensions.'); return; } const area = 0.5 * base * height; const perimeter = base + side1 + side2; const resultHTML = `
Area
${area.toFixed(4)}
Perimeter
${perimeter.toFixed(4)}
Base
${base.toFixed(4)}
Height
${height.toFixed(4)}
Side 1
${side1.toFixed(4)}
Side 2
${side2.toFixed(4)}
`; showResult('Triangle Properties', resultHTML); } // Circle calculations function calculateCircle() { const radius = parseFloat(document.getElementById('circle-radius').value); if (!radius || radius <= 0) { showError('Please enter a valid positive number for radius.'); return; } const area = PI * radius * radius; const circumference = 2 * PI * radius; const diameter = 2 * radius; const resultHTML = `
Area
${area.toFixed(4)}
Circumference
${circumference.toFixed(4)}
Diameter
${diameter.toFixed(4)}
Radius
${radius.toFixed(4)}
`; showResult('Circle Properties', resultHTML); } // Sphere calculations function calculateSphere() { const radius = parseFloat(document.getElementById('sphere-radius').value); if (!radius || radius <= 0) { showError('Please enter a valid positive number for radius.'); return; } const volume = (4/3) * PI * Math.pow(radius, 3); const surfaceArea = 4 * PI * Math.pow(radius, 2); const resultHTML = `
Volume
${volume.toFixed(4)}
Surface Area
${surfaceArea.toFixed(4)}
Radius
${radius.toFixed(4)}
`; showResult('Sphere Properties', resultHTML); } // Cylinder calculations function calculateCylinder() { const radius = parseFloat(document.getElementById('cylinder-radius').value); const height = parseFloat(document.getElementById('cylinder-height').value); if (!radius || radius <= 0 || !height || height <= 0) { showError('Please enter valid positive numbers for radius and height.'); return; } const volume = PI * Math.pow(radius, 2) * height; const surfaceArea = 2 * PI * radius * (height + radius); const resultHTML = `
Volume
${volume.toFixed(4)}
Surface Area
${surfaceArea.toFixed(4)}
Radius
${radius.toFixed(4)}
Height
${height.toFixed(4)}
`; showResult('Cylinder Properties', resultHTML); } // Cone calculations function calculateCone() { const radius = parseFloat(document.getElementById('cone-radius').value); const height = parseFloat(document.getElementById('cone-height').value); if (!radius || radius <= 0 || !height || height <= 0) { showError('Please enter valid positive numbers for radius and height.'); return; } const volume = (1/3) * PI * Math.pow(radius, 2) * height; const slantHeight = Math.sqrt(Math.pow(radius, 2) + Math.pow(height, 2)); const surfaceArea = PI * radius * (radius + slantHeight); const resultHTML = `
Volume
${volume.toFixed(4)}
Surface Area
${surfaceArea.toFixed(4)}
Slant Height
${slantHeight.toFixed(4)}
Radius
${radius.toFixed(4)}
Height
${height.toFixed(4)}
`; showResult('Cone Properties', resultHTML); } // Cube calculations function calculateCube() { const side = parseFloat(document.getElementById('cube-side').value); if (!side || side <= 0) { showError('Please enter a valid positive number for side length.'); return; } const volume = Math.pow(side, 3); const surfaceArea = 6 * Math.pow(side, 2); const spaceDiagonal = side * Math.sqrt(3); const resultHTML = `
Volume
${volume.toFixed(4)}
Surface Area
${surfaceArea.toFixed(4)}
Space Diagonal
${spaceDiagonal.toFixed(4)}
Side Length
${side.toFixed(4)}
`; showResult('Cube Properties', resultHTML); }
zaheerpashamd

Share
Published by
zaheerpashamd

Recent Posts

Audio Converter

🎧 aura convert · professional online audio converter aura convert client‑side MP3 · WAV ·…

6 months ago

Protect PDF

Protect PDF - Add Password | Secure & Free Protect PDF Add password protection to…

10 months ago

PNG to PDF Converter

PNG to PDF Converter PNG to PDF Converter Upload your PNG images and convert them…

10 months ago

PDF to PNG Converter

PDF to PNG Converter PDF to PNG Converter Upload your PDF file and convert it…

10 months ago

Advanced Image Resize Tool

Advanced Image Resize Tool - Free Online Image Resizer Home > Tools > Image Resize…

11 months ago

Algebra Calculator

Algebra Calculator Algebra Calculator Solve equations, simplify expressions, and perform algebraic operations Enter Expression or…

11 months ago