+++
title = "SphericalSegment"
+++
### SphericalSegment
A spherical segment, obtained from a spherical ball by two parallel cuts.
#### Constructor
```python
SphericalSegment(R, t, b)
```
Parameters:
- $ R $, radius
- $ t $, cut from top
- $ b $, cut from bottom
Constraint:
$ t+b \le 2R $
#### Usage
As for any other [Form factor](/ref/sample/particle/ff).
#### Implementation
Class {{% ref-class "Sample/HardParticle" "SphericalSegment" %}} inherits from the interface class
{{% ref-class "Sample/Particle" "Formfactor" %}}.
Computation involves numerical integration in vertical direction,
$$ F(\mathbf{q})=2\pi \exp\[iq_z(R-b)\] \int_{-R+b}^{R-t} \text{d}z \space r_z^2 \frac{J_1(q_{||}r_z)}{q_{||}r_z} \exp(iq_z z), $$
with the notation
$$ q_{||} := \sqrt{q_x^2 + q_y^2}, \quad r_z:=\sqrt{R^2-z^2} $$
Volume [has been validated]({{% url-src %}}/Tests/Unit/Sample/FormfactorBasicTest.cpp)
against
$$ V=\dfrac{\pi}{3} \[ 4R^3 - 3R(t^2+b^2) + (t^3 + b^3) \]. $$
#### Related shapes
More general:
- [SpheroidalSegment](/ref/sample/particle/ff/hard/spheroidalsegment)
- [EllipsoidalSegment](/ref/sample/particle/ff/hard/ellipsoidalsegment)
More special:
- [Sphere](/ref/sample/particle/ff/hard/sphere), if $t=b=0.$
#### Example
Scattering by uncorrelated, oriented truncated spheres for horizontal incidence. Rotation around $y$ axis:
Generated by {{% ref-ex "sas/sas-ff.py" %}} (`particle_geometry=SphericalSegment`).
#### History
Agrees with the IsGISAXS form factor "Sphere" [Lazzari, IsGISAXS manual v2.6 (2006)](http://www.insp.upmc.fr/oxydes/IsGISAXS/figures/doc/manual.html), Eq. 2.32 and "Truncated sphere" [Renaud et al, Surf Sci Rep 64, 255 (2009)](https://doi.org/10.1016/j.surfrep.2009.07.002), Eq. 228. It is *not* "Truncated sphere" of FitGISAXS, which is without top removal [Babonneau, FitGISAXS v130531 (2013)](https://pprime.fr/wp-content/uploads/2020/01/FitGISAXS_130531.zip).