Learn R Programming

OPI (version 2.10.1)

pixTodeg: Convert pixels to degrees for machine 'machine'

Description

Convert pixels to degrees for machine 'machine'

Usage

pixTodeg(xy, machine = "compass")

degTopix(xy, machine = "compass")

Arguments

xy

a 2 element vector c(x,y) where x and y are in pixels

machine

"compass" or ...?

Value

xy converted to degrees of visual field with the usual conventions or NA if machine is unknown

xy converted to pixels (top-left is (0,0)) for the machine or NA if machine is unknown

Examples

Run this code
# NOT RUN {
pixTodeg(c(1000, 200), machine="compass") # c(1.290323, 24.516129) degrees
pixTodeg(c(1920/2, 1920/2)) # c(0,0) degrees
degTopix(c(0, 0), machine="compass")  # c(960, 960) pixels
degTopix(c(-15, 2)) # c(495, 898) pixels
# }

Run the code above in your browser using DataLab