Skip to content

Commit ddac424

Browse files
committed
Fix
1 parent 5355651 commit ddac424

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

maths/volume.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ def vol_spheres_intersect(
6464
Calculate the volume of the intersection of two spheres.
6565
6666
The intersection is composed by two spherical caps and therefore its volume is the
67-
sum of the volumes of the spherical caps. First, it calculates the heights :math:`(h_1, h_2)`
68-
of the spherical caps, then the two volumes and it returns the sum.
67+
sum of the volumes of the spherical caps.
68+
First, it calculates the heights :math:`(h_1, h_2)` of the spherical caps,
69+
then the two volumes and it returns the sum.
6970
The height formulas are
7071
7172
.. math::
@@ -79,7 +80,8 @@ def vol_spheres_intersect(
7980
8081
if `centers_distance` is 0 then it returns the volume of the smallers sphere
8182
82-
:return: ``vol_spherical_cap`` (:math:`h_1`, :math:`radius_2`) + ``vol_spherical_cap`` (:math:`h_2`, :math:`radius_1`)
83+
:return: ``vol_spherical_cap`` (:math:`h_1`, :math:`radius_2`)
84+
+ ``vol_spherical_cap`` (:math:`h_2`, :math:`radius_1`)
8385
8486
>>> vol_spheres_intersect(2, 2, 1)
8587
21.205750411731103
@@ -127,11 +129,13 @@ def vol_spheres_union(
127129
128130
It is the sum of sphere :math:`A` and sphere :math:`B` minus their intersection.
129131
First, it calculates the volumes :math:`(v_1, v_2)` of the spheres,
130-
then the volume of the intersection :math:`i` and it returns the sum :math:`v_1 + v_2 - i`.
132+
then the volume of the intersection :math:`i` and
133+
it returns the sum :math:`v_1 + v_2 - i`.
131134
If `centers_distance` is 0 then it returns the volume of the larger sphere
132135
133136
:return: ``vol_sphere`` (:math:`radius_1`) + ``vol_sphere`` (:math:`radius_2`)
134-
- ``vol_spheres_intersect`` (:math:`radius_1`, :math:`radius_2`, :math:`centers\_distance`)
137+
- ``vol_spheres_intersect``
138+
(:math:`radius_1`, :math:`radius_2`, :math:`centers\_distance`)
135139
136140
>>> vol_spheres_union(2, 2, 1)
137141
45.814892864851146

0 commit comments

Comments
 (0)