-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTesting.py
109 lines (109 loc) · 2.99 KB
/
Testing.py
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
from DataType import Fraction
from DataType import Vector
import math
# print(Fraction(1/3)+Fraction(1/3))
# print(Fraction(1,3)+2)
# b = Fraction(4, 3)
# c = Fraction(1, 3)
# print((Fraction('4/5'))**(3))
p='my_name'
try:
p=Fraction('2+3/p3')
except:
p='praveen'
print(p)
# print(Fraction.min([Fraction(2/3),Fraction(3)]))
# print(Fraction('.56'))
# print(Fraction('.bar3')+Fraction('.bar3'))
# print(Fraction(1/3)+Fraction(1/30))
# print(1/3+1/3)
# print(c == b)
# print(max(b,c))
# print(int(c), int(b), float(c))
# t = Fraction(.2356)
# print(Fraction.max(b,c))
# print('gcd is here', Fraction.gcd(b, c))
# print('lcm is here', Fraction.lcm(b, c))
# print(Fraction(2.586767))
# p = Fraction(0.5, 0.51)
# print()
# print(b / c)
# b /= c
# print('power', b ** c)
# print(c + b - p * t)
# q = p * t
# w = c + b
# print(w - q)
# print()
# print(Fraction(2, -1))
# print(bool(b))
# print((c - b) * (t / w))
# c = Fraction(2, 5)
# b = Fraction(3, 4)
# print(b, type(b))
# print(c, type(c))
# d = 9
# print(b - d, 'int subtracted')
# print(d >= b)
# print(d <= b)
# print(b <= d)
# print(b >= d)
# print(type(d))
# print(type(b))
# print(Fraction(b))
# print(Fraction(4 / 2))
# print(b.simplify(), 'return simplified fraction')
# print(Fraction.are_like_fraction(3, 2 / 3, 6))
# print(Fraction.are_unlike_fraction(3, 2 / 3, 6))
# print(Fraction.max(b, c, t, q, 1))
# alist = [1, b, c, t, q]
# alist.sort()
# print(alist)
# print(Fraction(5 ** (1 / 2)))
# print(b)
# c = b.reciprocal()
# print(c)
# a = Fraction(2, 3)
# a += b
# print(a)
# print(str(a))
# print(Fraction('1.bar3'))
# print(Fraction('.bar3'))
# print(Fraction(-1, '-1.bar3'))
# print(Fraction('7.56'))
# print(float(Fraction('3/4')))
# print(Fraction(1))
# print(Fraction('3/4')+2)
#
# '''vector algebra'''
#
# ab = Vector('56', .89, 3)
# print(ab)
# print(ab.magnitude())
# print(Vector.magnitude(ab))
# print(ab.direction_cosine())
# print(math.degrees(ab.angle_with_x_rad()))
# print(math.degrees(ab.angle_with_y_rad()))
# print(math.degrees(ab.angle_with_z_rad()))
# print(ab + Vector(x=-9, z=1))
# print(ab.unit_vector_direction())
# o = 2
# print(-o)
# print(ab)
# print(ab * 4)
# print(Vector(2, 3) * ab)
# print(Vector(-3, -5, -6))
# print(ab.are_collinear(Vector(2, 3, 4)))
# print(Vector.are_collinear(Vector(4, 6, 8), Vector(2, 3, 4)))
# print(-ab)
# print(ab.get_direction_ratio())
# print(ab.dot_product(Vector(2, 1)))
# print(ab.projection(Vector(3, 4, 5)))
# print(Vector.projection(Vector(2, 3, 2), Vector(1, 2, 1)))
# print(math.sqrt(6) * 5 / 3)
# print(Vector.vector_joining(ab, Vector(3, 4, 5)))
# print(Vector.section_point_internal(Vector(2, 3, 4), Vector(5, 9, 8), 6, 4))
# print(Vector.section_point_external(Vector(2, 3, 4), Vector(5, 9, 8), 6, 4))
# print(Vector.angle_between_vector(Vector(1,1,-1),Vector(1,-1,1)))
# print(Vector.are_perpendicular(Vector(6,2,-8),Vector(4,-4,2)))
# print(Vector.area_of_triangle(Vector(2,3,4),Vector(3,4,6),Vector(1,1,1)))