#MATL , 11 bytes
MATL , 11 bytes
X/Z/0)2/YP/
Input is a sequence of complex numbers including the end point.
###Explanation
Explanation
Most of the work is done by the Z/ function (unwrap), which unwraps angles in radians by changing absolute jumps greater than or equal to pi to their 2*pi complement.
X/ % compute angle of each complex number
Z/ % unwrap angles
0) % pick last value. Total change of angle will be a multiple of 2*pi because
% the path is closed. Total change of angle coincides with last unwrapped
% angle because the first angle is always 0
2/ % divide by 2
YP/ % divide by pi
#MATL , 11 bytes
X/Z/0)2/YP/
Input is a sequence of complex numbers including the end point.
###Explanation
Most of the work is done by the Z/ function (unwrap), which unwraps angles in radians by changing absolute jumps greater than or equal to pi to their 2*pi complement.
X/ % compute angle of each complex number
Z/ % unwrap angles
0) % pick last value. Total change of angle will be a multiple of 2*pi because
% the path is closed. Total change of angle coincides with last unwrapped
% angle because the first angle is always 0
2/ % divide by 2
YP/ % divide by pi
MATL , 11 bytes
X/Z/0)2/YP/
Input is a sequence of complex numbers including the end point.
Explanation
Most of the work is done by the Z/ function (unwrap), which unwraps angles in radians by changing absolute jumps greater than or equal to pi to their 2*pi complement.
X/ % compute angle of each complex number
Z/ % unwrap angles
0) % pick last value. Total change of angle will be a multiple of 2*pi because
% the path is closed. Total change of angle coincides with last unwrapped
% angle because the first angle is always 0
2/ % divide by 2
YP/ % divide by pi
#MATL, 11 bytes
X/Z/0)2/YP/
Input is a sequence of complex numbers including the end point.
###Explanation
Most of the work is done by the Z/ function (unwrap), which unwraps angles in radians by changing absolute jumps greater than or equal to pi to their 2*pi complement.
X/ % compute angle of each complex number
Z/ % unwrap angles
0) % pick last value. Total angle change of angle will be a multiple of 2*pi because
% the path is closed. Total angle change of angle coincides with last unwrapped angle because
% angle because the first angle is always 0
2/ % divide by 2
YP/ % divide by pi
#MATL, 11 bytes
X/Z/0)2/YP/
Input is a sequence of complex numbers including the end point.
###Explanation
Most of the work is done by the Z/ function (unwrap), which unwraps angles in radians by changing absolute jumps greater than or equal to pi to their 2*pi complement.
X/ % compute angle of each complex number
Z/ % unwrap angles
0) % pick last value. Total angle change will be a multiple of 2*pi because
% the path is closed. Total angle change coincides with last unwrapped angle because
% the first angle is always 0
2/ % divide by 2
YP/ % divide by pi
#MATL, 11 bytes
X/Z/0)2/YP/
Input is a sequence of complex numbers including the end point.
###Explanation
Most of the work is done by the Z/ function (unwrap), which unwraps angles in radians by changing absolute jumps greater than or equal to pi to their 2*pi complement.
X/ % compute angle of each complex number
Z/ % unwrap angles
0) % pick last value. Total change of angle will be a multiple of 2*pi because
% the path is closed. Total change of angle coincides with last unwrapped
% angle because the first angle is always 0
2/ % divide by 2
YP/ % divide by pi
- 106.7k
- 10
- 139
- 382
#MATL, 11 bytes
X/Z/0)2/YP/
Input is a sequence of complex numbers including the end point.
###Explanation
Most of the work is done by the Z/ function (unwrap), which unwraps angles (inin radians) by changing absolute jumps greater than or equal to pi to their 2*pi complement.
X/ % compute angle of each complex number
Z/ % unwrap angles
0) % pick last value. Total angle change will be a multiple of 2*pi because
% the path is closed. Total angle change coincides with last unwrapped angle because
% the first angle is always 0
2/ % divide by 2
YP/ % divide by pi
#MATL, 11 bytes
X/Z/0)2/YP/
Input is a sequence of complex numbers including the end point.
###Explanation
Most of the work is done by the Z/ function (unwrap), which unwraps angles (in radians) by changing absolute jumps greater than or equal to pi to their 2*pi complement.
X/ % compute angle of each complex number
Z/ % unwrap angles
0) % pick last value. Total angle change will be a multiple of 2*pi because
% the path is closed. Total angle change coincides with last angle because
% the first angle is always 0
2/ % divide by 2
YP/ % divide by pi
#MATL, 11 bytes
X/Z/0)2/YP/
Input is a sequence of complex numbers including the end point.
###Explanation
Most of the work is done by the Z/ function (unwrap), which unwraps angles in radians by changing absolute jumps greater than or equal to pi to their 2*pi complement.
X/ % compute angle of each complex number
Z/ % unwrap angles
0) % pick last value. Total angle change will be a multiple of 2*pi because
% the path is closed. Total angle change coincides with last unwrapped angle because
% the first angle is always 0
2/ % divide by 2
YP/ % divide by pi