Posts

Showing posts with the label PHYSICS

i missed my practicals pt.1

Image
Works on pygame. Simply install pygame using cmd:      pip install pygame And run the code . Works on simple principle of drawing ray diagrams. First ray passes from optical center and the second ray passes from the focus. Image is drawn by drawing perpendicular to the x axis from the point of intersection. Dotted ray or image shows its virtual nature. Intersection points are found using basics mathematics and concepts from straight lines. Initial the code run and draws the graph of U vs V and then it is available for simulation. The rectangular hyperbola is the graph of U vs V.  A line drawn at 45 degrees from origin in the 2nd quadrant cuts the graph at 2f, 2f. This is used to determine the focal length of the given lens. Thanks to - My physics teacher, lab assistant, friends (Ayush, Ashwini) who helped in the experiment. (And yes, i didn't miss my practicals) dm

#4j:Coding in Python{TENSION FINDER}

Image
#tension print('Input tension to find tension.') j=str(input('Enter please: ')) w=str(input('Input yes if only 1 load is in water or no: ')) if w=='yes':     a1=int(input("Input 1 if you want gravity 10m/s**2 and Input 2 if you want gravity 9.8m/s**2"))     if a1==1:         vo=eval(input("Enter volume of object: "))         do=eval(input("Enter density of object: "))         dl=eval(input("Enter density of liquid: "))         g=10         t=(((vo)*g)*(dl-do))         print("Tension is ",t," N")     if a1==2:         vo=eval(input("Enter volume of object: "))         do=eval(input("Enter density of object: "))         dl=eval(input("Enter density of liquid: "))         g=9.8         t=(((vo)*g)*(dl-do))     ...

#4d. Codding in python {LAWS OF MOTION}

Image
#Laws of Motion. print ("If variables are initial velocity,Final velocity,Duration of time & Acceleration in one equation press 1") print ("If variables are Distance,Initial velocity,Duration of time & Acceleration in one equation press 2") z=int(input("Enter choice:")) if (z==1):     print("Find 'Acceleration' press 1"           "Find  'Duration of time' press 2."           "Find 'Initial velocity' press 3."           "Find  'Final velocity' press 4.")     y=int(input("Enter choice:"))     if(y==1):         u=int(input("Enter initial velocity: "))         v=int(input("Enter final velocity: "))         t=int(input("Enter duration of time: "))         a=(v-u)/t         print("Acceleration produced is %d"%(a))     if(y==2):     ...

#4b. Codding in Python {UNIT CONVERTER}.

Image
#Unit Converter print ("Press 1 for Temperature converter;Press 2 for cm-inch converter; Press 3 for mile-km converter") a=int(input("Enter choice:")) if (a==1):     print("Press 1 for C - F; Press 2 for F - K; Press 3 for C - K")     b=int(input("Enter choice:"))     if(b==1):         print("Press 1 for C - F; Press 2 for F - C")         z=int(input("Enter choice:"))         if(z==1):             c=int(input("Enter value in C :"))             f=(9*c-160)/5             print (f,"F")         if(z==2):             g=int(input("Enter value in F :"))             d=(5*g+160)/9             print (d,"C")         if(z>2) or (z<1):          ...