mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 06:25:23 +01:00
lint fixes
This commit is contained in:
@@ -158,7 +158,8 @@ def distance_two_points(max_val_xy=20, min_val_xy=-20):
|
||||
| --- | --- |
|
||||
| Find the distance between $(-19, -6)$ and $(15, -16)$ | $\sqrt{1256}$ |
|
||||
"""
|
||||
if max_val_xy < min_val_xy: max_val_xy, min_val_xy = min_val_xy, max_val_xy
|
||||
if max_val_xy < min_val_xy:
|
||||
max_val_xy, min_val_xy = min_val_xy, max_val_xy
|
||||
|
||||
point1X = random.randint(min_val_xy, max_val_xy + 1)
|
||||
point1Y = random.randint(min_val_xy, max_val_xy + 1)
|
||||
@@ -503,9 +504,7 @@ def line_equation_from_2_points(max_val=20):
|
||||
y2 = random.randint(-max_val, max_val)
|
||||
m1 = (y2 - y1) // math.gcd(y2 - y1, x2 - x1)
|
||||
m2 = (x2 - x1) // math.gcd(y2 - y1, x2 - x1)
|
||||
c1 = (y1 * (x2 - x1) -
|
||||
(y2 - y1) * x1) // math.gcd(y1 * (x2 - x1) - (y2 - y1) * x1,
|
||||
(x2 - x1))
|
||||
c1 = (y1 * (x2 - x1) - (y2 - y1) * x1) // math.gcd(y1 * (x2 - x1) - (y2 - y1) * x1, (x2 - x1))
|
||||
c2 = (x2 - x1) // math.gcd(y1 * (x2 - x1) - (y2 - y1) * x1, (x2 - x1))
|
||||
c = rf"{'+' if c1 >= 0 else '-'}\frac{{{abs(c1)}}}{{{c2}}}" if c1 != 0 else ""
|
||||
if c2 < 0:
|
||||
|
||||
@@ -261,9 +261,7 @@ def tribonacci_series(min_length=1, max_length=80):
|
||||
tribSeries = []
|
||||
for idx in range(i):
|
||||
if idx not in tribDict:
|
||||
tribDict[idx] = tribDict[idx -
|
||||
1] + tribDict[idx -
|
||||
2] + tribDict[idx - 3]
|
||||
tribDict[idx] = tribDict[idx - 1] + tribDict[idx - 2] + tribDict[idx - 3]
|
||||
tribSeries.append(tribDict[idx])
|
||||
return tribSeries
|
||||
|
||||
|
||||
@@ -220,8 +220,7 @@ def decimal_to_roman_numerals(max_decimal=4000):
|
||||
elif last_value == 4:
|
||||
solution += (roman_dict[div] + roman_dict[div * 5])
|
||||
elif 5 <= last_value <= 8:
|
||||
solution += (roman_dict[div * 5] + (roman_dict[div] *
|
||||
(last_value - 5)))
|
||||
solution += (roman_dict[div * 5] + (roman_dict[div] * (last_value - 5)))
|
||||
elif last_value == 9:
|
||||
solution += (roman_dict[div] + roman_dict[div * 10])
|
||||
x = math.floor(x % div)
|
||||
|
||||
Reference in New Issue
Block a user