Ahmed Blogs

Ahmed Blogs

Share

10/04/2025

Python code for Circle

import math
import matplotlib.pyplot as plt

# Define the radius of the circle
radius = 5

# Calculate diameter
diameter = 2 * radius

# Calculate circumference
circumference = 2 * math.pi * radius

# Calculate area
area = math.pi * radius**2

# Print the results
print(f"Radius: {radius} m")
print(f"Diameter: {diameter} m")
print(f"Circumference: {circumference} m")
print(f"Area: {area} sq m")

# Create a circle plot
circle = plt.Circle((0, 0), radius, color='blue', fill=False)
fig, ax = plt.subplots()
ax.add_artist(circle)
ax.set_aspect('equal', adjustable='datalim')
plt.xlim(-10, 10)
plt.ylim(-10, 10)
plt.gca().set_aspect('equal', adjustable='box')
plt.title("Circle with radius 5 m")
plt.grid()
plt.show()

07/26/2023

Three chief engineers in one frame. A great moment of adda.

07/16/2023

Good Day everyone! I’m in my Hometown Tangail, BD

Want your public figure to be the top-listed Public Figure in Allen?
Click here to claim your Sponsored Listing.

Category

Telephone

Website

Address


Sleepy Hollow Drive
Allen, TX
75002