mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-23 21:11:08 +00:00
parent
dbfa21813f
commit
79dc7c97ac
|
@ -57,7 +57,7 @@ class FuzzySet:
|
||||||
|
|
||||||
# Union Operations
|
# Union Operations
|
||||||
>>> siya.union(sheru)
|
>>> siya.union(sheru)
|
||||||
FuzzySet(name='Siya ∪ Sheru', left_boundary=0.4, peak=0.7, right_boundary=1.0)
|
FuzzySet(name='Siya U Sheru', left_boundary=0.4, peak=0.7, right_boundary=1.0)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
name: str
|
name: str
|
||||||
|
@ -147,10 +147,10 @@ class FuzzySet:
|
||||||
FuzzySet: A new fuzzy set representing the union.
|
FuzzySet: A new fuzzy set representing the union.
|
||||||
|
|
||||||
>>> FuzzySet("a", 0.1, 0.2, 0.3).union(FuzzySet("b", 0.4, 0.5, 0.6))
|
>>> FuzzySet("a", 0.1, 0.2, 0.3).union(FuzzySet("b", 0.4, 0.5, 0.6))
|
||||||
FuzzySet(name='a ∪ b', left_boundary=0.1, peak=0.6, right_boundary=0.35)
|
FuzzySet(name='a U b', left_boundary=0.1, peak=0.6, right_boundary=0.35)
|
||||||
"""
|
"""
|
||||||
return FuzzySet(
|
return FuzzySet(
|
||||||
f"{self.name} ∪ {other.name}",
|
f"{self.name} U {other.name}",
|
||||||
min(self.left_boundary, other.left_boundary),
|
min(self.left_boundary, other.left_boundary),
|
||||||
max(self.right_boundary, other.right_boundary),
|
max(self.right_boundary, other.right_boundary),
|
||||||
(self.peak + other.peak) / 2,
|
(self.peak + other.peak) / 2,
|
||||||
|
|
|
@ -4,14 +4,14 @@ from scipy.constants import G, c, pi
|
||||||
|
|
||||||
"""
|
"""
|
||||||
These two functions will return the radii of impact for a target object
|
These two functions will return the radii of impact for a target object
|
||||||
of mass M and radius R as well as it's effective cross sectional area σ(sigma).
|
of mass M and radius R as well as it's effective cross sectional area sigma.
|
||||||
That is to say any projectile with velocity v passing within σ, will impact the
|
That is to say any projectile with velocity v passing within sigma, will impact the
|
||||||
target object with mass M. The derivation of which is given at the bottom
|
target object with mass M. The derivation of which is given at the bottom
|
||||||
of this file.
|
of this file.
|
||||||
|
|
||||||
The derivation shows that a projectile does not need to aim directly at the target
|
The derivation shows that a projectile does not need to aim directly at the target
|
||||||
body in order to hit it, as R_capture>R_target. Astronomers refer to the effective
|
body in order to hit it, as R_capture>R_target. Astronomers refer to the effective
|
||||||
cross section for capture as σ=π*R_capture**2.
|
cross section for capture as sigma=π*R_capture**2.
|
||||||
|
|
||||||
This algorithm does not account for an N-body problem.
|
This algorithm does not account for an N-body problem.
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ This effect is used in polarimetry to measure the optical activity of a sample.
|
||||||
Real polarizers are also not perfect blockers of the polarization orthogonal to
|
Real polarizers are also not perfect blockers of the polarization orthogonal to
|
||||||
their polarization axis; the ratio of the transmission of the unwanted component
|
their polarization axis; the ratio of the transmission of the unwanted component
|
||||||
to the wanted component is called the extinction ratio, and varies from around
|
to the wanted component is called the extinction ratio, and varies from around
|
||||||
1:500 for Polaroid to about 1:106 for Glan–Taylor prism polarizers.
|
1:500 for Polaroid to about 1:106 for Glan-Taylor prism polarizers.
|
||||||
|
|
||||||
Reference : "https://en.wikipedia.org/wiki/Polarizer#Malus's_law_and_other_properties"
|
Reference : "https://en.wikipedia.org/wiki/Polarizer#Malus's_law_and_other_properties"
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -10,7 +10,6 @@ lint.ignore = [ # `ruff rule S101` for a description of that rule
|
||||||
"PLW2901", # PLW2901: Redefined loop variable -- FIX ME
|
"PLW2901", # PLW2901: Redefined loop variable -- FIX ME
|
||||||
"PT011", # `pytest.raises(Exception)` is too broad, set the `match` parameter or use a more specific exception
|
"PT011", # `pytest.raises(Exception)` is too broad, set the `match` parameter or use a more specific exception
|
||||||
"PT018", # Assertion should be broken down into multiple parts
|
"PT018", # Assertion should be broken down into multiple parts
|
||||||
"RUF001", # String contains ambiguous {}. Did you mean {}?
|
|
||||||
"RUF002", # Docstring contains ambiguous {}. Did you mean {}?
|
"RUF002", # Docstring contains ambiguous {}. Did you mean {}?
|
||||||
"RUF003", # Comment contains ambiguous {}. Did you mean {}?
|
"RUF003", # Comment contains ambiguous {}. Did you mean {}?
|
||||||
"S101", # Use of `assert` detected -- DO NOT FIX
|
"S101", # Use of `assert` detected -- DO NOT FIX
|
||||||
|
|
Loading…
Reference in New Issue
Block a user