Subtended Angle C++

Usage

subtended_angle(x1, y1, x2, y2, rx, ry, sw, sh, ez, ex = as.numeric(c(0)), ey = as.numeric(c(0)))

Arguments

x1
the horizontal coordinate of the first point on a screen (pixels)
y1
the vertical coordinate of the first point on a screen (pixels)
x2
the horizontal coordinate of the second point on a screen (pixels)
y2
the vertical coordinate of the second point on a screen (pixels)
rx
the horizontal resolution of the screen (pixels)
ry
the vertical resolution of the screen (pixels)
sw
the physical screen width (mm)
sh
the physical screen height (mm)
ez
the perpendicular distance from the viewer to the screen (mm)
ex
the horizontal offset of the viewer from screen center (mm)
ey
the vertical offset of the viewer from screen center (mm)

Value

degrees of visual angle

Description

Takes two screen coordinates and returns the angle (in degrees) subtended by those two points.

Examples

subtended_angle(835, 525, 845, 525, 1680, 1050, 473.76, 296.1, 750)
[1] 0.2154319