how to make a arc between two lines in python

 How to make a arc between two lines in python


Code :
from numpy import *
from matplotlib.pyplot import *
theta = eval(input("Enter the value of theta"))
t = linspace(0,theta,360)
r =10 # radius
l =  60 # length of the line
x = r*cos(radians(t))
y = r*sin(radians(t))
a =([0,l,0,l*cos(radians(theta))])
b=([0,0,0,l*sin(radians(theta))])
plot(x,y,a,b)
axis('equal')

Code Explanation
  • first we are going to import numpy and matplotlib
  • then we will give input upto which angle we want our arc angle is
  • here r is the radius of the arc
  • l is leght of the line between which our arc will be made
  • then we have define x and y variable that we have used and explained in circle to create the arc here
  • we will combine our line and arc plot graph to see the whole graph



Post a Comment

0 Comments