Author Topic: symmetric spline wavefunction  (Read 6278 times)

Offline mogn

  • Member
  • *
  • Posts: 443
symmetric spline wavefunction
« on: May 07, 2011, 01:33:58 PM »
In this wave function you have control over:

     the line along which the wave is generated
     the wavelength
     the amplitude 1 and 2 third of the wavelength
     the amplitude in the middle of the wave.

The wave has zero amplitude and gradient in the end points.
Uses a 6 order spline.


Offline Hetzen

  • Member
  • *
  • Posts: 1653
Re: symmetric spline wavefunction
« Reply #1 on: May 07, 2011, 09:37:23 PM »
Thanks Mogn. I always like to have a look at how you do things. I'm not sure how the math works with the dot product giving you the cos of the resultant angle, but I like it. It's one of those nodes I've never used, or found a use for before. But you've made this network easy to follow, and I can see this being very useful in the future. By my understanding, the modulo will give you parallel ramps in any direction defined by the top left constant vector.

Out of interest, how would you go about creating a vector direction from say an angle in a 360 arc defined by a constant scaler?

Thanks for sharing. Much appreciated.

Jon

Offline Dune

  • Member
  • *
  • Posts: 15082
    • www.ulco-art.nl
Re: symmetric spline wavefunction
« Reply #2 on: May 08, 2011, 07:51:10 AM »
Thanks Mogn, very interesting. I'll check it out.

Offline mogn

  • Member
  • *
  • Posts: 443
Re: symmetric spline wavefunction
« Reply #3 on: May 08, 2011, 08:41:16 AM »
The documentation of the dot function is partly wrong and not usable.
A better definition is: [A, B, C] dot [x, y, z] == [Ax, By, Cz]

Converting an arc scalar v to a vector:
Vector = [cos(v), 0, sin(v)]
« Last Edit: May 08, 2011, 08:45:43 AM by mogn »

Offline jo

  • Planetside Staff
  • *
  • Posts: 1729
Re: symmetric spline wavefunction
« Reply #4 on: May 09, 2011, 04:59:44 AM »
Hi Jon,

Out of interest, how would you go about creating a vector direction from say an angle in a 360 arc defined by a constant scaler?

You can use the rotate function nodes for that. They rotate about the origin so if you need to rotate about another point you may need to do a bit more work.

Regards,

Jo

Offline mogn

  • Member
  • *
  • Posts: 443
Re: symmetric spline wavefunction
« Reply #5 on: May 09, 2011, 07:45:36 PM »
The backside of the rotation function is that thr angle cannot be calculated by blue notes.

Before anybody discovers the errors in my calculations, I must go back to the drawingbord.

Offline Hetzen

  • Member
  • *
  • Posts: 1653
Re: symmetric spline wavefunction
« Reply #6 on: May 11, 2011, 10:45:12 AM »
Hi Jon,

Out of interest, how would you go about creating a vector direction from say an angle in a 360 arc defined by a constant scaler?

You can use the rotate function nodes for that. They rotate about the origin so if you need to rotate about another point you may need to do a bit more work.

Regards,

Jo

Thanks Jo.

As Mogn has mentioned, the values are then locked in the Rotation node, so can't be used in further parts of the calculation, or modulated to animate for example.

Cheers

Jon

Offline Hetzen

  • Member
  • *
  • Posts: 1653
Re: symmetric spline wavefunction
« Reply #7 on: May 11, 2011, 10:47:15 AM »
The documentation of the dot function is partly wrong and not usable.
A better definition is: [A, B, C] dot [x, y, z] == [Ax, By, Cz]

Converting an arc scalar v to a vector:
Vector = [cos(v), 0, sin(v)]

Thanks again Mogn. It really is that simple.

I'm slowly re-remembering my trig class at school.  ;D

Offline jo

  • Planetside Staff
  • *
  • Posts: 1729
Re: symmetric spline wavefunction
« Reply #8 on: May 11, 2011, 11:37:25 AM »
Hi mogn,

The backside of the rotation function is that thr angle cannot be calculated by blue notes.

Ah, right, of course. Sorry for the misdirection.

Regards,

Jo

Offline neon22

  • Member
  • *
  • Posts: 241
Re: symmetric spline wavefunction
« Reply #9 on: May 16, 2011, 01:49:47 AM »
Mogn - can you put the wave shape modifier into this too. (That Hetzen, Dune and others have been working on in this thread:
http://forums.planetside.co.uk/index.php?topic=6111.0)
I.e. based on whether the sine is going up or down - push it out or back...

Offline mogn

  • Member
  • *
  • Posts: 443
Re: symmetric spline wavefunction
« Reply #10 on: May 17, 2011, 08:02:24 AM »
If I correct my algorithm, such that the middle amplitude is fixed and the amplitude in a fixed point between 0 and the middle point
is specified, this arrangment can be changed in the following way:

subtract the mod value from the scaled axis giving a number N for each wave.
calculate x= mod(PI*(N*(N+1),1)*0.4
use x instead if the fixe point between 0 and 0.5

This will give a wave with fixed wavelengt fixed max amplitude, but each wave has a different form.

correcting my algorith involves solving two equations with two variables:

A*f(x   ) + B*G(x  ) = amplitude at x
A*f(0.5) + B*g(0.5) = amplitude at 0.5  

where f(x) = ((1-x)*x)**2 *((1-x)**2 + x**2)
         g(x) = (1-x)**3 * x**3

The wave function being A*f(s) + B*g(s) where s is running from 0 to 1.0      
« Last Edit: May 17, 2011, 08:04:16 AM by mogn »

Offline mogn

  • Member
  • *
  • Posts: 443
Re: symmetric spline wavefunction
« Reply #11 on: May 18, 2011, 06:20:14 PM »
The node network used to solve two equations in two unknown is:

Offline mogn

  • Member
  • *
  • Posts: 443
Re: symmetric spline wavefunction
« Reply #12 on: May 21, 2011, 12:06:15 PM »
Updated Wavefunction.

If you draw a line between the points X!,Y! and X2,Y2 and the lines crosses the axis in a point > 1/3 the wave
starts and ends with a valley (values less than zero). if the crossing point is less than 1/3 the middle points lies in a
valley.

Offline neon22

  • Member
  • *
  • Posts: 241
Re: symmetric spline wavefunction
« Reply #13 on: May 21, 2011, 09:37:45 PM »

Offline dandelO

  • Member
  • *
  • Posts: 2401
Re: symmetric spline wavefunction
« Reply #14 on: May 21, 2011, 10:40:49 PM »
amazing skills !! I am astounded...

I'm always astounded by Mogn's posts, it's not natural.