示例#1
0
 def deduct(self, sources: List[Condition], target: Condition):
     a = sources[1].attr_value
     b = sources[2].attr_value
     c = target.attr_value
     if a is None:
         a = math.sqrt(c * c - b * b)
         sources[1], sources[2], target = sources[2], target, sources[1]
         target.attr_value = a
     elif b is None:
         b = math.sqrt(c * c - a * a)
         sources[1], sources[2], target = sources[1], target, sources[2]
         target.attr_value = b
     else:
         target.attr_value = math.sqrt(a * a + b * b)
     return sources, target
示例#2
0
 def deduct(self, sources: List[Condition], target: Condition):
     a = sources[0].attr_value
     b = sources[1].attr_value
     c = sources[2].attr_value
     p = (a + b + c) / 2
     target.attr_value = math.sqrt(p * (p-a) * (p-b) * (p-c))
     return sources, target
示例#3
0
 def deduct(self, sources: List[Condition], target: Condition):
     a = sources[0].attr_value
     b = sources[1].attr_value
     c = sources[2].attr_value
     cos_theta = (a**2 + b**2 - c**2) / (2 * a * b)
     theta = math.degrees(math.acos(cos_theta))
     target.attr_value = theta
     return sources, target
 def deduct(self, sources: List[Condition], target: Condition):
     target.attr_value = sources[0].relationship.sum_value - sources[
         1].attr_value
     return sources, target
 def deduct(self, sources: List[Condition], target: Condition):
     target.attr_value = sources[0].attr_value
     return sources, target
示例#6
0
 def deduct(self, sources: List[Condition], target: Condition):
     A = math.radians(sources[0].attr_value)
     B = math.radians(sources[1].attr_value)
     a = sources[2].attr_value
     target.attr_value = a * math.sin(B) / math.sin(A)
     return sources, target
 def deduct(self, sources: List[Condition], target: Condition):
     ratio = sources[-1]
     target.attr_value = sources[0].attr_value * ratio
     return sources[:-1], target
示例#8
0
 def deduct(self, sources: List[Condition], target: Condition):
     a = sources[1].attr_value
     b = sources[2].attr_value
     target.attr_value = a * b / 2
     return sources, target
 def deduct(self, sources: List[Condition], target: Condition):
     gama = math.radians(sources[0].attr_value)
     a = sources[1].attr_value
     b = sources[2].attr_value
     target.attr_value = math.sqrt(a**2 + b**2 - 2 * a * b * math.cos(gama))
     return sources, target
示例#10
0
 def deduct(self, sources: List[Condition], target: Condition):
     triangle1_line = sources[1].attr_value
     triangle2_line = sources[2].attr_value
     target.attr_value = triangle1_line / triangle2_line
     return sources, target