+++
title = "HorizontalCylinder"
+++
### HorizontalCylinder
A horizontal truncated circular cylinder along x-axis
#### Constructor
Full form
```python
HorizontalCylinder(R, H, t, b)
```
and short form
```python
HorizontalCylinder(R, H) == HorizontalCylinder(R, H, 0, 0)
```
Parameters:
- $ R $, radius
- $ H $, height
- $ t $, cut from top
- $ b $, cut from bottom
Constraint:
$ 2R - t - b \ge 0 $
#### Usage
As for any other [Form factor](/ref/sample/particle/ff).
#### Implementation
Class {{% ref-class "Sample/HardParticle" "HorizontalCylinder" %}} inherits from the interface class
{{% ref-class "Sample/Particle" "Formfactor" %}}.
Form factor is computed as
$$ F(\mathbf{q})=2 L \space \text{sinc}\Big(q_x\dfrac{L}{2}\Big) \exp\[iq_z(R-b)\]
\int_{-R+b}^{R-t} \text{d}z \space \sqrt{R^2-z^2} \space \text{sinc}(q_y\sqrt{R^2-z^2}) \exp\[iq_z z\] , $$
Volume [has been validated]({{% url-src %}}/Tests/Unit/Sample/FormfactorBasicTest.cpp)
against
$$V=L \Big\( (R-t)\sqrt{2Rt-t^2}- (R-b)\sqrt{2Rb-b^2} + R^2 \Big\[\text{asin}\Big(1-\frac{t}{R}\Big) + \text{asin}\Big(1-\frac{b}{R}\Big) \Big\]
\Big\).$$
#### Related shapes
More general:
- [Cylinder](/ref/sample/particle/ff/hard/cylinder), if vertical and non-truncated.
#### Example
Scattering by uncorrelated, oriented horizontal truncated cylinders for horizontal incidence. Rotation around $z$ axis:
Generated by {{% ref-ex "sas/sas-ff.py" %}} (`particle_geometry=HorizontalCylinder`).
#### History
Introduced in BornAgain 1.20.
API has changed in v24.