View source: R/sl.smalltriag.area.R
sl.smalltriag.area | R Documentation |
Compute the area of a small triangle on a sphere.
sl.smalltriag.area(lon, lat)
lon |
a vector of length 3 specifying the longitudes of the triangle vertices. |
lat |
a vector of length 3 specifying the latitudes of the triangle vertices. |
This function works in x-y-z coordinates, meaning that it becomes imprecise for larger triangles (e.g. spanning more than a few degrees). However, the function is comparably fast and may therefore be favoured when applied to many small triangles. If accuracy is an issue, use sl.triag.area
instead.
A scalar giving the area of the triangle (on a unit sphere).
Helge Goessling
sl.triag.area
, sl.polygon.area
sl.smalltriag.area(lon=c(0,2,1),lat=c(0,0,1))
## Should return:
## [1] 0.0003045813
## (Compare the result of sl.triag.area: 0.0003046329)
sl.smalltriag.area(c(0,60,30),c(0,0,30))
## Should return:
## [1] 0.2454951
## (Compare the result of sl.triag.area: 0.2866951)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.