Sine wave struggles

Hi,

For a project I am working with some sine waves, I got it working kind of how I want but struggling with one imperative point of this.

I want te create a few waves with different values ie, height and repetitions. But all sine waves need to start at 0,0,0mm and end at 1000,0,0mm I got it now till the point that the wave stops at 1000mm on the x axis but I need it to stop, and be on 1000,0,0 (so on the base line)

I try to understand what sort of math I need to incorporate to make it work but I can’t figure it out… anybody has a way of doing this?

btw i need lines to sometimes arrives from -y and sometimes from +y, so that would mean not al waves need to be 360, sometimes start at 180 and end at 180 etc etc.

File attached: (25.6 KB)

Your geometry is not internalized:

missing

From the flyover view of this model though, I might prefer to start from scratch as this looks too complicated:

I’m not sure what the file you attached is - it seems unrelated to your question and image. Are you sure you uploaded the right file?

Anyway, to make sine waves that are zero at the start and end of a curve, you can reparametrize and evaluate the curve from zero to one, multiply this t value by some integer*Pi and take the sine of that:
sinewave.gh (8.0 KB)

ah damn, this is the wrong file…

ok again the correct one:

sinewave1.gh (16.5 KB) sinewave1.3dm (3.5 MB)

Sounds good! You didn’t internalize your curve so had to add my own:

nice thanks, this looks good, but only using odd numbers make does the trick now?

Sorry, I don’t understand the question.

It seems your file works, but, only with uneven numbers (5,7,9 etc) if I divide by 6, you see at the end of the line a tiny piece of the next line, sorry hard to explain…

And to elaborate on @DanielPiker’s code to answer the thread issue:

1 Like

ah wow! yesss, only adjustable heigt and some offset at the start, to make some lines start at 180 degrees… I have been struggling for two nights with this haha

oke got the height adjustable through a multiplication before the movement on z…

any tips on how the adjust the start position?

Add a phase shifter. Thanks @DanielPiker, that’s so simple! :+1:


sinewave_2020Oct6a.gh (14.2 KB)

Wavelength, frequency, amplitude…

1 Like

I started to answer your question with a copy of this - wavelength, frequency, amplitude and damping:

The white and blue curves on the XZ plane are lovely and can be shifted in phase.

@DanielPiker’s equation in code is simpler but I might dabble further with this…

1 Like

thank you guys so much!!

1 Like