Utilities#

auto classyq::surface_of_cap(double theta, double r) -> double#

Surface area of spherical cap.

Note

Leopardi uses the equivalent formula: \( A = 4 \pi r^{2} \sin^{2}\left(\frac{\theta}{2}\right)\).

Parameters
  • theta[in] polar angle between the rays from the center of the sphere to the apex of the cap (the pole) and the edge of the disk forming the base of the cap.

  • r[in] radius of the sphere.

Returns

surface of the spherical cap \( A = 2\pi r^{2}(1 - \cos \theta)\).

template<typename T>
auto classyq::memory_with_units(size_t count) -> std::string#

Information on allocation size in human-readable units.

Template Parameters

T – type of allocated data.

Parameters

count[in] number of elements allocated.

Returns

string representation of amount of allocated data.