triangleArea: Area of a triangle

Description Usage Arguments Value Author(s) See Also Examples

View source: R/triangleArea.R

Description

calculate Area of a planar triangle

Usage

1
triangleArea(x, y, digits = 3)

Arguments

x

Vector with 3 values (x coordinates of triangle corners)

y

Ditto for y.

digits

Number of digits the result is rounded to. DEFAULT: 3)

Value

Numeric

Author(s)

Berry Boessenkool, [email protected], 2011

See Also

berryFunctions::distance

Examples

1
2
3
4
5
a <- c(1,5.387965,9); b <- c(1,1,5)
plot(a[c(1:3,1)], b[c(1:3,1)], type="l", asp=1)#; grid()

triangleArea(a,b)
#triangleArea(a,b[1:2])

brry/OSMscale documentation built on April 18, 2018, 8:23 p.m.