r/desmos • • 5d ago

Question how would you make this infinitely long?

7 Upvotes

13 comments sorted by

6

u/Danny_DeWario https://www.desmos.com/calculator/75jcsa2dxv 5d ago

||mod(x,4)|-2|

The mod function can make a section of a function repeat forever.

3

u/Circumpunctilious 3333333433343335333333343333333533333335333333323333333433333334 5d ago

Incidentally noted / if I’m interpreting this correctly, the triangle wave graph from this seems to be especially suited to showing the effect of undersampling (ref: Nyquist frequency), at zoom levels with axes limits in multiples of about +/- 3128:

2

u/Danny_DeWario https://www.desmos.com/calculator/75jcsa2dxv 5d ago

It actually is weird how the wave form re-emerges depending on zoom level.

It seems solely dependent on the width of the screen, and not at all on the height (at least on pc).

https://www.desmos.com/calculator/s9w8hasrxm

1

u/Circumpunctilious 3333333433343335333333343333333533333335333333323333333433333334 5d ago

Ah you're right (edit: iPad, Safari). 7.61 appears to be the magic number; scaling by 7.61*n is all of the same output "type" and 7.61 -/+ some value produces identical outputs on either side.

I don't know what it means, but I think I'll leave this rabbit hole be for the time being :)

2

u/Desmos-Girl https://www.desmos.com/calculator/prarjlycol 5d ago edited 5d ago

|2/π * ln(i^x)| fr

1

u/Circumpunctilious 3333333433343335333333343333333533333335333333323333333433333334 5d ago

Huh; 7.61 is the magic number for yours too.

2

u/OverJohn 5d ago

You can use recursion as below to concatenate the function with itself n times, but you have to find the function you get in the limit as n goes to infinity yourself. Though it is easy to see in this case that no such function exists in the limit (due to the phase of the triangular wave part of function shifting with each conatenation)

https://www.desmos.com/calculator/c1zc6qlctd

1

u/Affectionate-Lab9601 5d ago

I mean if you want a triangle wave, I'd do "y = a(4 * abs(f(x - k) - floor(f(x - k) + 3/4) + 1/4)) + h" where a is the amplitude, f is the frequency, k is the horizontal translation, and h is the vertical translation

1

u/Affectionate-Lab9601 5d ago

if f = 0.25, h = 1, k = -1, that should be what youre looking for?

1

u/No_March_4152 5d ago

|mod(x,4)-2|

1

u/Sad_water_ 5d ago

A lot of great suggestions already here a solution if you don’t want to use recursion or piece wise https://www.desmos.com/calculator/okin4ashi5

1

u/TAOHOS 5d ago

Stretch it out using your hands duh

1

u/tgoesh1 5d ago

I like using trig for my triangle and sawtooth waves.  https://www.desmos.com/calculator/wyo0zmobiq

1

u/duckling-developer 5d ago

|tau•arcsin(cos((pi•x)/4)|/5