Learn R Programming

shotGroups (version 0.6.2)

getDistance: Get distance based on absolute and angular size

Description

Calculates the distance to an object based on the object's absolute and angular size.

Usage

getDistance(x, angular, conversion = 'm2cm', type = c('MOA', 'SMOA', 'mrad', 'mil'))

Arguments

x
a numerical vector of absolute object sizes.
angular
a numerical vector of angular object sizes.
conversion
how to convert the measurement unit for the returned distance to object to that of given absolute object size. Either a character vector indicating the conversion like 'm2cm' for meter to centimeter, 'yd2in' for yards to inches,
type
type of angular measure used in angular: 'MOA' for minute of angle, 'SMOA' for Shooter's MOA, 'mrad' for milliradian, 'mil' for NATO mil. See details.

Value

  • A numerical vector with the distance values.

Details

1 MOA (minute of angle, arcmin) = 1/60 degree. Shooter's MOA = SMOA = Inches Per Hundred Yards IPHY. 1 inch at 100 yards = 1 SMOA. 1 milliradian = 1/1000 radian. 1 mil = 2*pi/6400 radian (NATO definition: the circle circumference is divided into 6400 mils). Details are given in the vignette, see vignette('shotGroups')

See Also

getMOA, fromMOA

Examples

Run this code
size <- seq(1, 20, by=5)   # inch
dst  <- 100                # yard

# get angular size in MOA from absolute size
angular <- getMOA(size, dst=dst, conversion='yd2in', type='MOA')

# this should return dst throughout
getDistance(size, angular=angular, conversion='yd2in', type='MOA')

Run the code above in your browser using DataLab