Author Topic: Sinus  (Read 6812 times)

Offline Zelos

  • Bot Overlord
  • ****
  • Posts: 707
    • View Profile
Sinus
« on: October 24, 2005, 10:23:03 AM »
I have a question on sinus curves, its easy to make one if it goes along the X axel, but how do you do to calculate X/Y coordinate if the line the sinus have its center on have an angel of Z°?
When I have the eclipse cannon under my control there is nothing that can stop me from ruling the world. And I wont stop there. I will never stop conquering worlds through the universe. All the worlds in the universe will belong to me. All the species in on them will be my slaves. THE ENIRE UNIVERSE WILL BELONG TO ME AND EVERYTHING IN IT :evil: AND THERE IS NOTHING ANYONE OF you CAN DO TO STOP ME. HAHAHAHAHAHAHAHA

Offline Griz

  • Bot Overlord
  • ****
  • Posts: 608
    • View Profile
Sinus
« Reply #1 on: October 24, 2005, 12:07:33 PM »
Quote
I have a question on sinus curves, its easy to make one if it goes along the X axel, but how do you do to calculate X/Y coordinate if the line the sinus have its center on have an angel of Z°?
well the Y value isn't going to change.
(assuming the x axis is from left to right, the Y up to down, and Z front to back?]
so wouldn't the new X value just be X*sin(Zangle)?
or perhaps I misunderstand your question.

check these pages out:
http://www.econym.demon.co.uk/isotut/
http://www.econym.demon.co.uk/isotut/simple.htm

I use these pages a lot for help in understanding isosurfaces ...
so perhaps you can find something to help you visualize such functions
in 3D and how they work.

if not ...
well then perhaps I will get you hooked on raytracing and programming
the amazing program POVray. ;)  
http://www.povray.org/
http://news.povray.org/groups/
it's Freeware!!!
information needs to be free!
« Last Edit: October 24, 2005, 12:08:28 PM by Griz »
不知
~griz~
[/color]
   "The selection of Random Numbers is too important to be left to Chance"
The Mooj  a friend to all humanity
[/color]

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Sinus
« Reply #2 on: October 24, 2005, 12:30:11 PM »
My sinus's are clogged right now.

But I guess that's sort of off topic isn't it.

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Sinus
« Reply #3 on: October 24, 2005, 12:48:13 PM »
That'll be the Asian bird flu  :rolleyes:
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Zelos

  • Bot Overlord
  • ****
  • Posts: 707
    • View Profile
Sinus
« Reply #4 on: October 24, 2005, 02:06:51 PM »
I nwant it to be like this, it might be ugly but I hope it shows what I want to show.
When I have the eclipse cannon under my control there is nothing that can stop me from ruling the world. And I wont stop there. I will never stop conquering worlds through the universe. All the worlds in the universe will belong to me. All the species in on them will be my slaves. THE ENIRE UNIVERSE WILL BELONG TO ME AND EVERYTHING IN IT :evil: AND THERE IS NOTHING ANYONE OF you CAN DO TO STOP ME. HAHAHAHAHAHAHAHA

Offline Zelos

  • Bot Overlord
  • ****
  • Posts: 707
    • View Profile
Sinus
« Reply #5 on: October 24, 2005, 02:07:36 PM »
and not like this
When I have the eclipse cannon under my control there is nothing that can stop me from ruling the world. And I wont stop there. I will never stop conquering worlds through the universe. All the worlds in the universe will belong to me. All the species in on them will be my slaves. THE ENIRE UNIVERSE WILL BELONG TO ME AND EVERYTHING IN IT :evil: AND THERE IS NOTHING ANYONE OF you CAN DO TO STOP ME. HAHAHAHAHAHAHAHA

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Sinus
« Reply #6 on: October 24, 2005, 02:13:24 PM »
All you need is to plot a point with a Y offset from your line. Make the offset equal to the sin of the x position of the point on the

For a line where X=Y this is pretty easy

This should do what you want in its simplest form

Code: [Select]
for x=1 to 1000
  pset(x,x),1                'draw diagonal
  pset(x,x+sin(x)*100  'draw sin curve superimposed on the slope
next x
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Sinus
« Reply #7 on: October 24, 2005, 02:14:43 PM »
Just occurred to me that code might do the curve that you dont want.
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Sinus
« Reply #8 on: October 24, 2005, 02:19:12 PM »
I see the function you want I think.  Sort of a sinusoidal stairstep looking thing.

I'm not 100% sure to be honest.  xsin(x) will give you the one you don't want...

It's been many years since trig.

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Sinus
« Reply #9 on: October 24, 2005, 02:23:35 PM »
I think you might need to do xsin(x),ysin(y) while the result is under the line and xsin(x),y-sin(y) when it's above.

I could be wrong though and I can't be assed to go test it.
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Zelos

  • Bot Overlord
  • ****
  • Posts: 707
    • View Profile
Sinus
« Reply #10 on: October 24, 2005, 02:44:12 PM »
the thing is that it cant be depended on X, it need to be depended on something else, like Z wich = 1 step, and from wich step decied X/Y
When I have the eclipse cannon under my control there is nothing that can stop me from ruling the world. And I wont stop there. I will never stop conquering worlds through the universe. All the worlds in the universe will belong to me. All the species in on them will be my slaves. THE ENIRE UNIVERSE WILL BELONG TO ME AND EVERYTHING IN IT :evil: AND THERE IS NOTHING ANYONE OF you CAN DO TO STOP ME. HAHAHAHAHAHAHAHA

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Sinus
« Reply #11 on: October 24, 2005, 02:46:00 PM »
Oh, this is getting complex isn't it ;)

Multivariable functions always give me a headache  :blink:

Probably you'll want to make a function by parametrization.

Offline Zelos

  • Bot Overlord
  • ****
  • Posts: 707
    • View Profile
Sinus
« Reply #12 on: October 24, 2005, 02:48:36 PM »
It gotta be sin/cos angel then somekinda formula to calculate its position by that value and waht step it is. I want it to be able to go around for a whole circle
When I have the eclipse cannon under my control there is nothing that can stop me from ruling the world. And I wont stop there. I will never stop conquering worlds through the universe. All the worlds in the universe will belong to me. All the species in on them will be my slaves. THE ENIRE UNIVERSE WILL BELONG TO ME AND EVERYTHING IN IT :evil: AND THERE IS NOTHING ANYONE OF you CAN DO TO STOP ME. HAHAHAHAHAHAHAHA

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Sinus
« Reply #13 on: October 24, 2005, 02:53:04 PM »
I wrote a spirograph program once.

It moved the centre of a circle along a circular path while simultaneously drawing a circle around the moving center.

That was kind of fun  :D
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Sinus
« Reply #14 on: October 24, 2005, 05:23:57 PM »
Quote
My sinus's are clogged right now.

But I guess that's sort of off topic isn't it.

Now , Num, Dont you drive...., you have to walk all the time? (I remember you telling me you had to go back home trough a winter storm or somthing)

Zelos,
 I would of approched it like this: first draw a virtual sin curve and then rotate it.

For a circle its a bit more tricky:

When you draw a circles with a compas, your radios is nice and constant, thats why you get a nice circle.

But now apply sin to the radios for any givin plot of a circles boarder. And you get exactly what you are looking for.

All you have to know now how to do rotational ploting...


Somthing like  X = sin(ang) * Radios , Y = cos(ang) * Radios , gives you a circle for any ang...
so you will use somthing like:
 X = sin(ang) * sin(Radios) , Y = cos(ang) *  sin(Radios)

err... now there might be an easyer method of rotation by using above to draw a reguler sloped line... I cant think of it, so experiment see what happens...
« Last Edit: October 24, 2005, 05:40:49 PM by Botsareus »