Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • 18e6614
  • /
  • geometries.Rd
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge
swh:1:cnt:5d74f500ce66cb0fa6d249e9b16d384de6a69138
directory badge
swh:1:dir:18e6614afcd58febed40a92c6881f70665f28dab

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
geometries.Rd
\name{g.sphere}
\alias{g.sphere}
\alias{g.spheroid}
\alias{g.cylinder}

\title{
  Surface Area and Volume of Geometrical Objects
}

\description{
  \itemize{
    \item \code{g.sphere} the surface and volume of a sphere
    \item \code{g.spheroid} the surface and volume of a spheroid
    \item \code{g.cylinder} the surface and volume of a cylinder;
      note that the surface area calculation ignores the top and bottom.
  }
}

\usage{

g.sphere(x)
g.spheroid (x, b = 1)
g.cylinder (x, L = 1)

}

\arguments{
  \item{x }{the radius 
  }
  \item{b }{the ratio of long/short radius of the spheroid;
    if b<1: the spheroid is oblate.
  }
  \item{L }{the length of the cylinder
  }
}

\value{
  A list containing:
  \item{surf }{the surface area 
  }
  \item{vol }{the volume 
  }
}

\author{
  Filip Meysman <filip.meysman@nioz.nl>,
  Karline Soetaert <karline.soetaert@nioz.nl>
}

\examples{

 mf <- par(mfrow = c(3, 2))
 x  <- seq(from = 0, to = 1, length = 10)
 plot(x, g.sphere(x)$surf, main = "sphere surface")
 plot(x, g.sphere(x)$vol, main = "sphere volume")
 plot(x, g.spheroid(x, b = 0.5)$surf, main = "spheroid surface")
 plot(x, g.spheroid(x, b = 0.5)$vol, main = "spheroid volume")
 plot(x, g.cylinder(x, L = 1)$surf, main = "cylinder surface")
 plot(x, g.cylinder(x, L = 1)$vol, main = "cylinder volume")
 par("mfrow" = mf)

}
\keyword{utilities}


back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API