/usr/share/psychtoolbox-3/PsychCal/PolarToSensor.m is in psychtoolbox-3-common 3.0.11.20140816.dfsg1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | function [sensor] = PolarToSensor(pol)
% [sensor] = PolarToSensor(pol)
%
% Converts from polar sensor coordinates to
% rectangular sensor coordinates.
%
% Polar coordinates are defined as radius, azimuth, and elevation.
%
% Inverts SensorToPolar.
%
% See also SensorToPolar, SensorToCyl, CylToSensor.
%
% 9/26/93 dhb Added calData argument.
% 2/6/94 jms Changed 'polar' to 'pol'
% 2/20/94 jms Added single argument case to avoid cData.
% 4/5/02 dhb, ly New calling interface.
% 11/6/06 dhb Only allow one input arguemnt.
[n,m] = size(pol);
if (n ~= 3)
error('Cannot handle polar coordinates with dimension other than 3');
end
sensor = zeros(n,m);
sensor(1,:) = pol(1,:).*cos(pol(3,:)).*cos(pol(2,:));
sensor(2,:) = pol(1,:).*cos(pol(3,:)).*sin(pol(2,:));
sensor(3,:) = pol(1,:).*sin(pol(3,:));
|