Learn R Programming

shotGroups (version 0.2-2)

getMOA: Conversion to minutes of angle

Description

Converts object size to MOA (minutes of angle).

Usage

getMOA(x, dst, conversion = 'm2cm')

Arguments

x
a numerical vector of object sizes.
dst
a numerical vector of viewing distances.
conversion
how to convert the measurement unit for distance to target to that of the (x,y)-coordinates. Either a character vector indicating the conversion: 'm2cm' for meter to centimeter, 'm2mm' for meter to millimeter, 'yd2in'

Value

  • A numerical vector with the MOA values.

Warning

The calculation leads to rounding errors after a few significant digits.

See Also

fromMOA

Examples

Run this code
objSize <- seq(10, 30, by=5)  # cm
objDst  <- 25                 # m
getMOA(objSize, dst=objDst, conversion='m2cm')

## check rounding problems
## this should return objSize
fromMOA(getMOA(objSize, objDst, conversion='m2cm'),
        objDst, conversion='m2cm')

Run the code above in your browser using DataLab