Radius (distance from center to edge)
Diameter (distance across the center)
How to Calculate the Circumference of a Circle
The circumference of a circle is the total distance around its outer edge. It is essentially the "perimeter" of the circle. To calculate it, you only need to know one measurement: either the radius or the diameter.
There are two primary formulas used depending on the information you have available:
Using Radius (r): C = 2 × π × r
Using Diameter (d): C = π × d
In these formulas, π (Pi) is a mathematical constant approximately equal to 3.14159.
Step-by-Step Guide
Identify the Radius or Diameter: If you have a line from the center to the edge, that is the radius. If you have a line going all the way across through the center, that is the diameter.
Apply the Formula: If using the radius, multiply it by 2 and then by Pi. If using the diameter, simply multiply it by Pi.
Determine the Units: The circumference will always be in the same units as your input (e.g., inches, centimeters, meters).
Real-World Examples
Object
Input Type
Measurement
Calculation
Circumference
Bicycle Wheel
Diameter
26 inches
3.14159 × 26
~81.68 in
Pizza
Radius
6 inches
2 × 3.14159 × 6
~37.70 in
Circular Garden
Diameter
10 meters
3.14159 × 10
~31.42 m
Why Knowing the Circumference Matters
Understanding the circumference is vital in various fields. For engineers, it determines the length of material needed for circular pipes. For athletes, it defines the distance of a single lap on a circular track. In everyday life, knowing the circumference helps when buying covers for circular tables or sizing tires for vehicles.
function updateLabels() {
var type = document.getElementById("inputType").value;
var label = document.getElementById("valueLabel");
if (type === "radius") {
label.innerText = "Enter Radius:";
} else {
label.innerText = "Enter Diameter:";
}
}
function calculateCircumference() {
var type = document.getElementById("inputType").value;
var value = parseFloat(document.getElementById("inputValue").value);
var resultBox = document.getElementById("calc-result-box");
var resultText = document.getElementById("resultText");
var pi = Math.PI;
var circumference = 0;
var area = 0;
if (isNaN(value) || value <= 0) {
resultText.innerHTML = "Please enter a valid positive number.";
resultBox.style.display = "block";
return;
}
if (type === "radius") {
circumference = 2 * pi * value;
area = pi * Math.pow(value, 2);
} else {
circumference = pi * value;
area = pi * Math.pow((value / 2), 2);
}
resultText.innerHTML = "Circumference:" + circumference.toFixed(4) + " units" +
"Area of Circle: " + area.toFixed(4) + " square units" +
"Diameter: " + (type === "radius" ? (value * 2).toFixed(4) : value.toFixed(4)) + " units" +
"Radius: " + (type === "radius" ? value.toFixed(4) : (value / 2).toFixed(4)) + " units";
resultBox.style.display = "block";
}