I plotted the following in MATLAB and Desmos:
y = cos(x + 6998666554443343) (1)
The plot is shown here: Plot of (1)
This staircase behaviour seems to appear with any large number. The following plot with an extra digit in its phase is another example:
y = cos(x + 69986665544433456) (2) Plot of (2)
I think that I am crossing the limits of resolution somehow. Can someone explain the reason behind this 'staircase' behaviour?
Matlab natively uses double precision floating point. As floating point values grow in magnitude the spacing between consecutive representable values gets larger. This spacing is referred to as machine epsilon and can be evaluated via
epsin Matlab. For example,eps(6998666554443343)returns1, which explains your first stair-stepped plot.eps(69986665544433456)returns8, which is why your second plot is even coarser. Double precision only supports consecutive integer values up to2^53(seeflintmax), which is ~9.0072e+15.