How this calculation works
Measure first-harmonic association between paired angular positions and a linear measurement using both cosine and sine components. The result is a nonnegative multiple-correlation magnitude, together with its squared value and a reproducible permutation test. It is invariant to rotating the angular origin and avoids treating the circular seam as a jump. Higher-harmonic patterns and dependence between rows require separate treatment.
r_c=Corr(y,cosθ), r_s=Corr(y,sinθ), r_cs=Corr(cosθ,sinθ); R²=(r_c²+r_s²−2r_cr_sr_cs)/(1−r_cs²), R=√R². Permutation p=(1+# permuted R²≥observed R²)/(B+1).A worked example
Eight equally spaced angles with measurements 5.2,4.1,3.2,1.4,.8,1.8,2.9,4.6 give R²=.98317329 and R=.99155095. With 999 permutations and seed 12345, the prototype records no permuted statistic as large as the observed one and reports p=.001. An independent six-observation fixture enumerates all 720 permutations and gives 12 exceedances, exact p=1/60.
Good to know
6–200 aligned finite angle/measurement pairs, angles in radians. Measurements, sine and cosine must be nonconstant and the centered sine/cosine matrix nondegenerate. 99–4,999 Fisher–Yates permutations using a supplied uint32 seed and Mulberry32 PRNG. First-harmonic association only; Monte Carlo test assumes exchangeability. No sign, phase estimate, adjusted R², causal claim, serial/block permutation or automatic multiple-testing correction.
Reference: Method reference (opens in a new tab) ↗
Why a direct angle correlation can fail
An angle just below two pi lies near an angle just above zero, even though their numeric labels are far apart. A direct Pearson correlation with the labels can change simply because the angular seam is moved.
Sine and cosine encode the circular location without that artificial discontinuity. The statistic measures how well their linear combination accounts for the centered measurement, making it appropriate for a single wave around the circle.
Compare this with the Circular mean of three angles calculator. A mean direction describes one circular sample rather than paired linear-angular dependence.
The result is a magnitude without a sign
Both sine and cosine coefficients can change when the angular origin is rotated. Their combined fitted values remain the same after a consistent rotation, so the multiple correlation provides a coordinate-independent association magnitude.
There is no unique positive or negative direction around a full circle. A high R says that a first-harmonic wave fits well; it does not identify which angle maximizes the response, and this page does not estimate or test a preferred phase.
Preparing paired radian observations
Each angular position must correspond to the linear measurement on the same row. Convert degrees by multiplying by pi/180 before entry. Values outside a standard interval are mathematically allowed because sine and cosine are periodic.
A set containing only one angular position gives no circular variation. Some two-direction configurations also make the sine/cosine design singular. The calculator rejects these cases instead of dividing by a near-zero denominator and returning an unstable association.
Working through the eight-angle example
The default angles span one full rotation in eighth-turn increments. Their measurements rise near zero and fall near pi, closely following a one-wave pattern. The computed R² is about .98317, so the fitted harmonic accounts for about 98.3 percent of centered sample variation.
The corresponding R is about .99155. These are descriptive in-sample summaries; with only eight observations they do not establish predictive accuracy. A model with a full angular wave can fit small samples strongly without guaranteeing the same pattern in future observations.
What is permuted and why
The test keeps the angular positions fixed and shuffles the measurement labels across them. Under an exchangeability null, such pairings are equally plausible, producing a reference distribution for an association at least as large as the observed one.
The same statistic is recomputed for each shuffle. The plus-one estimate prevents a Monte Carlo result of zero when no generated shuffle exceeds the observed statistic. With 999 permutations, the smallest reported p value is .001, not proof that the true tail probability equals exactly .001.
Reproducibility and an exact small case
A fixed seed and shuffle algorithm make the simulated result reproducible. Increasing the permutation count improves Monte Carlo resolution but does not repair violations of the exchangeability assumption. Report both the count and seed alongside the p value.
An independent fixture with six observations enumerates all 720 index permutations rather than simulating a subset. Twelve meet or exceed its observed R², giving exact permutation probability 1/60. This checks the statistic and tail convention separately from the random-number generator.
Patterns and dependencies the statistic misses
A response with two peaks per rotation can be strongly angular yet have little first-harmonic association. For example, cos(2θ) can be orthogonal to both cosθ and sinθ on a balanced grid. Low R therefore does not rule out all circular dependence.
Measurements collected over time or within subjects may also be nonexchangeable. Shuffling them freely can create an invalid null distribution. Use a design-aware model or restricted permutation analysis when temporal or clustered structure matters.
A few questions, answered
Should I enter degrees or radians?
Radians. Multiply degrees by pi/180 before entry.
Why is there no negative correlation?
The statistic is the magnitude of a combined sine/cosine relationship; angular origin and phase remove a unique sign.
Does p=.001 mean exactly one chance in a thousand?
With 999 shuffles and no exceedance, .001 is the minimum plus-one Monte Carlo estimate, not an exact tail probability.
Can it detect two peaks per rotation?
Not reliably. It measures the first harmonic; a higher-harmonic pattern can have a small R.