Learn R Programming

swfscMisc (version 1.6.5)

box.area: Area of a Box

Description

Calculate the area of a square on the earth.

Usage

box.area(lat, lon, edge, units = "nm")

Arguments

lat, lon

The latitude and longitude of the lower right corner of the box in decimal degrees.

edge

The length of one side of the square in decimal degrees.

units

units of distance. Can be "km" (kilometers), "nm" (nautical miles), or "mi" (statute miles).

Author

Eric Archer eric.archer@noaa.gov

Examples

Run this code
#What is the area of a 5 degree grid off of San Diego, CA?
box.area(32.87, -117.25, edge = 1, units = "nm")
box.area(32.87, -117.25, edge = 1, units = "km")
box.area(32.87, -117.25, edge = 1, units = "mi")

Run the code above in your browser using DataLab