mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-25 18:38:39 +00:00
Compare commits
2 Commits
062957ef27
...
1984d97171
Author | SHA1 | Date | |
---|---|---|---|
|
1984d97171 | ||
|
672e7bde2e |
@ -33,10 +33,7 @@ def retroactive_resolution(
|
|||||||
|
|
||||||
x: NDArray[float64] = np.zeros((rows, 1), dtype=float)
|
x: NDArray[float64] = np.zeros((rows, 1), dtype=float)
|
||||||
for row in reversed(range(rows)):
|
for row in reversed(range(rows)):
|
||||||
total = 0
|
total = np.dot(coefficients[row, row + 1 :], x[row + 1 :])
|
||||||
for col in range(row + 1, columns):
|
|
||||||
total += coefficients[row, col] * x[col]
|
|
||||||
|
|
||||||
x[row, 0] = (vector[row] - total) / coefficients[row, row]
|
x[row, 0] = (vector[row] - total) / coefficients[row, row]
|
||||||
|
|
||||||
return x
|
return x
|
||||||
|
@ -7,6 +7,8 @@ def arc_length(angle: int, radius: int) -> float:
|
|||||||
3.9269908169872414
|
3.9269908169872414
|
||||||
>>> arc_length(120, 15)
|
>>> arc_length(120, 15)
|
||||||
31.415926535897928
|
31.415926535897928
|
||||||
|
>>> arc_length(90, 10)
|
||||||
|
15.707963267948966
|
||||||
"""
|
"""
|
||||||
return 2 * pi * radius * (angle / 360)
|
return 2 * pi * radius * (angle / 360)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user