area_shpere: Calculates the surface area of segments of spheres of radius...

View source: R/area_shpere.R

area_shpereR Documentation

Calculates the surface area of segments of spheres of radius 'r', defined by the azimuth and elevation angles 'theta' and 'phi'. The calculation os based on the expression S = 2 * pi * R * h, given on http://mathworld.wolfram.com/SphericalCap.html. 'h' can be expressed as R * (1-cos(phi)), and for two elevation angles phi2 >= phi1 we get the following surface area of the resulting "disc" (can be illustrated by cutting an orange by two parallel intersections, and calculate the are of the orange skin): S = 2 * pi * R^2 * ( (1-cos(phi2)) - (1-cos(phi1))) = 2 * pi * R^2 * ( cos(phi1) - cos(phi2)). Splitting the resulting surface into parts by azimuth angle is straight foreward: S = R^2 * ( (1-cos(phi2)) - (1-cos(phi1))) * (theta2 - theta1).

Description

Calculates the surface area of segments of spheres of radius 'r', defined by the azimuth and elevation angles 'theta' and 'phi'. The calculation os based on the expression S = 2 * pi * R * h, given on http://mathworld.wolfram.com/SphericalCap.html. 'h' can be expressed as R * (1-cos(phi)), and for two elevation angles phi2 >= phi1 we get the following surface area of the resulting "disc" (can be illustrated by cutting an orange by two parallel intersections, and calculate the are of the orange skin): S = 2 * pi * R^2 * ( (1-cos(phi2)) - (1-cos(phi1))) = 2 * pi * R^2 * ( cos(phi1) - cos(phi2)). Splitting the resulting surface into parts by azimuth angle is straight foreward: S = R^2 * ( (1-cos(phi2)) - (1-cos(phi1))) * (theta2 - theta1).

Usage

area_shpere(r = 1, theta = c(0, 2 * pi), phi = c(0, pi), deg = FALSE)

Arguments

r

is the radii of the spheres.

theta

is either a vector of two elements representing the lower and upper azimuth angle of the spherical sector, or a two column matrix of the same.

phi

is either a vector of two elements representing the lower and upper elevation angle of the spherical sector, or a two column matrix of the same.

deg

is TRUE if the angles are given in degrees.


arnejohannesholmin/echoIBM documentation built on April 14, 2024, 11:37 p.m.