# Math help: Spiral expression

Hello Everybody
I’m trying to make a spiral movement. I found this formula on wikipedia:

In facer it is became this:
X: (160 + cos(#DWFSS#)/#DWFSS#)
Y: (100 + sin(#DWFSS#)/#DWFSS#)

Everything it seemed to be beautiful, but it doesn’t work. Shape just doesn’t move.
I try to discompose formula to find the problem, and I’ve found that it is the division symbol /
In fact if I replace it with multiplication symbol everything works! But in the wrong direction: Spiral enlarge

So, what I’m doing it wrong? I’ve tried some workaround but I didn’t find the right one

I like this:
X = (((sin((-(#DWFSS#+180)/180)pi))120)+160)
Y = (((cos((-(#DWFSS#+180)/180)pi))120)+160)

That 160 is holding a steady orbit right at the edge of the creator circle. But you could multiply that 160 by different fractions of DWFSS to get the spiral ur looking for. Like 160DWFSS0.1 and try different values to see what happens. Sorry i’m not in front of a computer this weekend.

John

1 Like

Actually that is probably incorrect. Mathematically you are correct, but you need to adjust to use rotational maths.

Try:

BTW: This is essentially exactly what @jmorga106 just stated above, but he uses ‘/180*pi’ to convert to radians.

LOL ok I shouldn’t propose formulas when I’m not in front of a computer haha. Yeah so what I said above doesn’t work at all.

Here are the orbit equations I’ve used a few times. Just for clarity, those 147’s in the formulae are holding the orbit. In this case the orbit is held at a radius of 147 pixels from the center (160,160).

X: (((sin((((360-#DWFSS#)-122)/180)*pi))*147)+160)
Y: (((cos((((360-#DWFSS#)-122)/180)*pi))*147)+160)

Now to make a spiral, we just need to convert the 147’s to something that will grow from 0 to some max radius in the minute that is transpiring. So DWFSS is good for that. Just multiply it by some factor that will keep an object on the screen as long as possible before the minute starts over again.

Playing around with values, DWFSS * 0.47 (almost half of DWFSS) will just spiral your object off-screen (around 9:30) before the minute starts over again. Think about it… half of the 360 max for DWFSS is 180 which is too far off screen. The max screen radius is 160. So a little less than half of DWFSS will push the object right to the edge on-screen through :59 seconds before starting over again.

X: (((sin((((360-#DWFSS#)-122)/180)pi))(#DWFSS#*0.47))+160)
Y: (((cos((((360-#DWFSS#)-122)/180)pi))(#DWFSS#*0.47))+160)

inspection is on.

HTH,
John

1 Like

Thank both to help!
Unfortunately the two solutions don’t solve the problem
@jmorga106 one gives 0 as x and y point. I try to edit in different way but I can’t find problem

@andrew.dowden one instead gives two fix points: 160 and 100 (the one at the start of expression). I’ve found that putting a value after / it works, but as in the first try in the wrong direction.

Then I try a simple expression 100/(#DWFSS#). It doesn’t work. So I think the problem is that /#DWFSS# is broken…
you know what is the quicker way to report this to facer? Create a suggestion topic?

PS. I saw you’re second comment JMorga, you’re formula is very complete and detailed, I will sure get a further eye to understand how it works. thank you for the nice job
The trouble now is get the spiral from out to inside, but if /#DWFSS# doesn’t work I think it’s impossible…

It may not help but I achieved an effect like this without a formula.

Basicallly I substituted an image for the second hand and set the following stats:

W:
(sin(#DWE#-wakeRand(0, (wakeRand(3,10)(pi2))))50+150)
H:
(sin(#DWE#-wakeRand(0, (wakeRand(3,10)
(pi*2))))*50+135)
R:
((#DWFSS#*0.5)*38.75)

Essentially having the image shrink and grow and spin faster. It took some tweaking of the numbers by eyeball, so it’d need to be changed to suit your image used.

I did the same thing with this watch: (the comet)