Вы находитесь на странице: 1из 4

NAME:

Sohai
lShai
kh.
STD:
Sybsc(
CS)
,8906
PRACTI
CALNO.
3

Q1)
i
mpor tnumpyas
npx =np.l
inspace( -
22,22,80)pri
nt(x)
[
-22. -
21.44303797- 20.88607595- 20.32911392-19.7721519
-
19. 21518987- 18.65822785-18. 10126582-17.5443038-16.98734177
-
16. 43037975- 15.87341772-15. 3164557-14.75949367-14.20253165
-
13. 64556962- 13.08860759-12. 53164557-11.97468354-11.41772152
-
10. 86075949- 10.30379747-9.74683544- 9.18987342-8.63291139
-8.07594937 - 7.
51898734 - 6.96202532 - 6.40506329 -5.84810127
-5.29113924 - 4.
73417722 - 4.17721519 - 3.62025316 -3.06329114
-2.50632911 - 1.
94936709 - 1.39240506 - 0.83544304 -0.27848101
0.27848101 0. 83544304 1. 39240506 1. 94936709 2. 50632911
3.06329114 3. 62025316 4. 17721519 4. 73417722 5. 29113924
5.84810127 6. 40506329 6. 96202532 7. 51898734 8. 07594937
8.63291139 9. 18987342 9. 7468354410. 30379747 10. 86075949
11. 4177215211. 9746835412. 5316455713. 0886075913. 64556962
14. 2025316514. 7594936715. 3164557 15. 8734177216. 43037975
16. 9873417717. 544303818. 10126582 18. 6582278519. 21518987
19. 7721519 20. 3291139220. 88607595 21. 4430379722. ]

Q2)
x=np.l
inspace(-
7,
7,50)pri
nt(x)
[-
7. -6.
71428571- 6.42857143-6.14285714 - 5.85714286-5.57142857
-
5.28571429-5. -4.71428571-4.42857143 -4.14285714-3.85714286
-
3.57142857-3.28571429- 3. -2.71428571-2.42857143-2.14285714
-
1.85714286-1.57142857- 1.28571429- 1. -
0.71428571-0.42857143
-
0.142857140. 14285714 0. 428571430. 71428571 1. 1.
28571429
1.571428571.85714286 2. 142857142. 42857143 2. 714285713.
3.285714293.57142857 3. 857142864. 14285714 4. 428571434.71428571
5. 5.285714295. 571428575.857142866. 142857146. 42857143
6.714285717. ]

Q3)
x=np.l
inspace(0,
15,
100)p
r
int(x)
[
0. 0.151515150.
30303030.
454545450.606060610.75757576
0.909090911. 06060606 1.
212121211.363636361. 515151521. 66666667
1.818181821. 96969697 2.
121212122.272727272. 424242422. 57575758
2.727272732. 87878788 3.
030303033.181818183. 333333333. 48484848
3.636363643. 78787879 3.
939393944.090909094. 242424244. 39393939
4.545454554. 69696974.
848484855. 5.
151515155.3030303
5.454545455. 60606061 5.
75757576 5.
909090916. 060606066. 21212121
6.363636366. 51515152 6.
666666676.818181826. 969696977. 12121212
7.272727277. 42424242 7.
575757587.727272737. 878787888. 03030303
8.181818188.333333338.484848488.636363648.787878798.93939394
9.090909099.242424249.393939399.545454559.69696979.84848485
10. 10.1515151510.303030310.4545454510.6060606110.75757576
10.9090909111.0606060611.2121212111.3636363611.5151515211.66666667
11.8181818211.9696969712.1212121212.2727272712.4242424212.57575758
12.7272727312.8787878813.0303030313.1818181813.3333333313.48484848
13.6363636413.7878787913.9393939414.0909090914.2424242414.39393939
14.5454545514.696969714.8484848515. ]

Q4)
x=Point (0,0)y
=Point(2,2) z
=Point(-
1,
1)w=Poi nt(
3,
4)x.dist anc
e(y
)2* sqr t(2)
y.
distance( w)
sqrt
(5) x.dist
ance(z) sqr t(
2)

Q5
x=Point(
0,0)
y=Point(
2,2)
z=Point(
-1,
1)
Point
.is_
coll
inear
(x,
y,
z)F
alse

Q6
x=Point
(0,0,
0)y
=
Point
(2,
2,2)z=P
oint
(-
1,-
1,-
1)
w=Point(
3,4,
-
7)Poi
nt.
are_coplanar
(x,
y,
z,
w)Tr
ue

Q7
A=Poi nt(0,2)B=Point
(5,2)
C=Poi nt(3,0)Point
.i
s_coll
i
near (A,B,C)False
L=Line( A,B)
L=Line( Point(0,
2),
Point
(5,2)
)L.
e
quation( )
y-
2L.distance(
C)2
Q8
P=Poi nt(5,2)
Q=Poi nt(5,-
2)R=Poi nt(5,
0)
Poi nt.
are_coplanar (P,
Q)
TruePoi nt.are_coplanar(
P,R) Tr
uePoi nt.are_copl
a
nar( Q,
R)Tr ue
R=Ray (
(5,2),(
5,-2))
P.l
engt h
0
Q.length
0
P.distance( Q)
4
R.slope
oo

Q9
P=Poi nt
( 3,-1)P.t
ransfor
m(Mat r
ix(
[[
1,0,
0],
[
0,-
1,
0],[
0,0,1]]))
Point2D( 3,
1)P.scale( 2,0)P
oi
nt2D( 6,
0)P.scale( 0,1.5)
Point2D( 0,-3/2)
P.
transfor m( Matri
x([
[0,
1,
0],
[
1,0,
0],
[0,
0,1]
])
)
Point2D( -1,3)

Q10
P=Poi nt(4,-
2)
P.
transfor m( Matr
ix(
[[
-
1,
0,0],
[0,1,0],
[0,
0,
1]]
))
Point2D(-
4,-
2)
P.
scal e(3,0)Po
i
nt2D( 12,
0)P.scale(0,2.
5)
Point2D( 0,-
5)
P.
transf orm( Matr
ix(
[[
0,-
1,0]
,[
-1,
0,
0],
[
0,0,
1]]
))
Point2D( 2,-
4)

Q11
P=Poi nt(3,
8)
P.
transf orm( Mat
ri
x([
[1,
0,
0],
[
0,-1,
0],
[
0,0,
1]]
))
Point2D( 3,-
8)
P.
scal e(6,0)Po
i
nt2D( 18,
0)P.r
ot ate(pi/
6)
Point
2D( -
35048094716167/25000000000000,
842820323027551/
100000000000000)
P.
tr
ansfor
m(Matr
ix([
[0,
-
1,0]
,[
-
1,
0,
0],
[
0,0,
1]]
))
Poi
nt2D(-
8,-
3)huu

Q12)
P=Poi nt(4,-
2)
P.
transf orm( Matr
ix(
[[
-
1,
0,0],
[0,1,0],
[0,
0,
1]]
))
Poi nt2D(-
4,-2)
P.
scal e(5,0)Po
i
nt2D( 20,
0)P.r
ot ate(pi/
2)Point2D( 2,4)
P.
transf orm( Matr
ix(
[[
1,0,0],
[
7/2,1,0]
,
[0,
0,
1]]
))
Point2D( -3,
-2)

Q13)
P=Point(-
2,
4)P.tr
ansform(Matrix
([[
1,7,0],
[
0,1,0],
[
0,0,
1]
]
))Point2D(-
2,-
10)
P.
transform(Matri
x([
[1,
7,0]
,[7/2,1,
0],[
0,0,
1]]
))
Point2D(12,
-
10)
P.
transform(Matri
x([
[1,
7,0]
,[4,1,
0],
[0,0,
1]]
))
Point
2D( 14,
-10)
P.
rotate(pi
/3)
Point
2D( -
17856406460551/ 4000000000000, 267949192431123/
1000000000000000)

Q14)
P=Point
(1,
0,0)
P.
transf
orm( Matri
x([
[0,
-
1,
0,0]
,[
1,0,
0,
0,],
[
0,0,
1,0],
[
0,0,
0,
1]]
))
Poi
nt3D(
0,1,
0)

Q15)
P=Point
(1,
0,
0)
P.
transf
orm(Matr
ix(
[[
0,0,
-
1,
0],
[0,
1,
0,0]
,
[1,
0,
0,
0],
[0,
0,0,
1]]
))
Poi
nt3D(
0,0,
1)

Вам также может понравиться