SEM-4 MTC PRACTICAL-4

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Sem4 Practical 4: Geometry using Sympy I

Write Python programs to do the following using sympy:


1. Check whether the following points are collinear.
a) A (0, 2), B (5, 2 ) ,C (3,0) , (b) P (5, 2), Q (5, –2 ) , R (5,0).
2. Find the distance between the following pairs of points.
a) (0, 7), (5, 7 ) , (b) (3,0) , (0, – 2), (c) (3, 2 ) ,(5 ,6),
3. Declare the line passing through the points (2, 3) and (4,1). Find its slope, equation, and
its distance from the point (0, 0).
4. Declare the line segment joining the points P(1,2) and Q(7,2). Find its length, slope,
midpoint and its distance from the point (5, 0).
5. Find the point of intersection of line L passing through the points (1, 3) and (4,0) and
segment S joining the points (2,1) and (6,4). Find the angle between the line and the
segment. Find the distance of point (1,1) from this line L.
6. Find the length of a ray between the points (2,2) and (5,7). Also find its slope, and angle
between this ray and the line segment joining the points (1,2) and (7,2).
7. Find the point of intersection of lines L1 and L2, given by the equations
x + y =2 and 3x+2y =1. Also find the slopes of lines L1 and L2.
8. Declare points L(2, 1, 3), M(5, 1, 4), N(–2 , 1, 7), P(1 , 1, –7). Determine whether these
points are coplanar. Find the equation of line passing through points L,M,N .
Find the equation of plane passing through points L,M,N .
9. Write a Python program to find the point if intersection of the lines 2x + y = 3 and
x− 2y + 4 = 0.
10. Declare a regular polygon with 6 sides and radius 1 centered at (1, 2) and find its area and
perimeter. Print its vertices.
11. Declare a polygon with 5 sides and radius 2 centered at (0, 0) and find its point of
intersection with the line given by the equation x + 2 y = 5.
12. Declare triangle ABC where A (2 ,2), B(4, 2), C( 3, 6) , for this triangle find:
i) Area, ii) Angles, iii) Is it isosceles triangle? iv)Is it equilateral triangle?
v)Is it scalene triangle? vi)Is pt (3,1) inside ∆ ABC? vii)Is it right angled ∆?
13. Declare PQRS where P (3 , 1), Q(5, 1), R( 5, 5) ,S(3,5). Using sympy for this
quadrilateral find: i)Perimeter ,ii) Centroid, iii) Angles at points P,Q , R and S separately,
iv) vertices, v) Point of intersection of above ∆ABC and PQRS.
14. Declare regular polygon with 6 sides and radius 5 centered at (0, 0). Using sympy for this
polygon find: i)Is pt (4, 4) inside this? ii)Is it convex polygon? iii) Find area of polygon.
15. Generate regular polygon with 8 sides and radius 3.5 centered at (1, 1), find its area
perimeter and centroid.
----------------------------------- **** ------------------------------------

You might also like