-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAreaCircle.py
More file actions
79 lines (54 loc) · 1.74 KB
/
AreaCircle.py
File metadata and controls
79 lines (54 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: user
#
# Created: 29/04/2019
# Copyright: (c) user 2019
# Licence: <your licence>
#-------------------------------------------------------------------------------
print("""
def area_of_circle(r):
return (22/7)*(r)**2
r=float(input("Please input the desired radious,r = "))
print(area_of_circle(r))
def area_of_circle(r):
a= (22/7)*(r)**2
return a
print(area_of_circle(7))
""")
def area_of_circle(r):
return (22/7)*(r)**2
r=float(input("Please input the desired radious,r = "))
print(area_of_circle(r))
def area_of_circle(r):
a= (22/7)*(r)**2
return a
print(area_of_circle(7))
#____________________________________________+++++++++++++++++++
def area_of_circle(radius):
radius = distance(xc, yc, xp, yp)
a= (22/7)*(radius)**2
return a
def distance(x1, y1, x2, y2):
return math.sqrt( (x2-x1)**2 + (y2-y1)**2 )
print(distance(1, 2, 4, 6))
print(area_of_circle(7))
#############################################
def area_of_circle(xc, yc, xp, yp):
radius = distance(xc, yc, xp, yp)
a= (22/7)*(radius)**2
return a
def distance(xc, yc, xp, yp):
return math.sqrt( (xp-xc)**2 + (yp-yc)**2 )
print(area_of_circle(1, 2, 4, 6))
#______________++_____________+++++______________________
##########################################################
def area_of_circle(xc, yc, xp, yp):
radius = math.sqrt( (xp-xc)**2 + (yp-yc)**2 )
a= (22/7)*(radius)**2
return a
#def distance(xc, yc, xp, yp):
#return math.sqrt( (xp-xc)**2 + (yp-yc)**2 )
print(area_of_circle(1, 2, 4, 6))