+++
title = "Pyramid2"
+++

### Pyramid2

A truncated pyramid with rectangular base.

<img src="/img/draw/ff/3d/Pyramid2.png" width="30%" >
<img src="/img/draw/ff/2d/Pyramid2_xy.svg" width="30%">
<img src="/img/draw/ff/2d/Pyramid2_xz.svg" width="30%">

#### Constructor

```python
Pyramid2(L, W, H, alpha)
```

Parameters:
- L, edge length of the base
- W, edge width of the base
- H, height
- alpha, dihedral angle $\alpha$ between the base and each of the four trapezoidal lateral faces.

Constraint:

$H \le \dfrac{\tan\alpha}{2} min(L,W)$

#### Usage

As for any other [Form factor](/ref/sample/particle/ff).

#### Implementation

Class [Pyramid2]({{% url-src %}}/Sample/HardParticle/Polyhedra.h) inherits from the interface class
{{% ref-class "Sample/Particle" "Formfactor" %}}.

Form factor computation is based on the generic form factor of a polyhedron
provided by {{% link-libformfactor %}}.

Volume [has been validated]({{% url-src %}}/Tests/Unit/Sample/FormfactorBasicTest.cpp)
against
$$ V=H\Big[LW-\dfrac{(L+W)H}{\tan\alpha}+\dfrac{4}{3}\dfrac{H^2}{\tan^2\alpha}\Big]. $$

#### Related shapes

More special:
- [Pyramid4](/ref/sample/particle/ff/hard/pyramid4), if $L=W$.
- [Box](/ref/sample/particle/ff/hard/box), if $\alpha=90^{\circ}$.

#### Example

Scattering by uncorrelated, oriented pyramids for horizontal incidence. Rotation around $z$ axis:

<img src="/img/auto/ff/Pyramid2.png">

Generated by {{% ref-ex "sas/sas-ff.py" %}} (`particle_geometry=Pyramid2`).

#### History

Was named "AnisoPyramid" up to BornAgain 1.19.

Agrees with the "In plane anisotropic pyramid" form factor of IsGISAXS [Lazzari, IsGISAXS manual v2.6 (2006)](http://www.insp.upmc.fr/oxydes/IsGISAXS/figures/doc/manual.html), Eq. 2.38-2.39;
[Renaud et al, Surf Sci Rep 64, 255 (2009)](https://doi.org/10.1016/j.surfrep.2009.07.002), Eq. 216-217,
except for different parametrization. This is *not* the "Anisotropic pyramid"
of FitGISAXS, which is a true pyramid with an off-center apex [Babonneau, FitGISAXS v130531 (2013)](https://pprime.fr/wp-content/uploads/2020/01/FitGISAXS_130531.zip).
