Darwinbots Forum
General => Off Topic => Topic started by: Zelos 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°?
-
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/)
http://www.econym.demon.co.uk/isotut/simple.htm (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://www.povray.org/)
http://news.povray.org/groups/ (http://news.povray.org/groups/)
it's Freeware!!!
information needs to be free!
-
My sinus's are clogged right now.
But I guess that's sort of off topic isn't it.
-
That'll be the Asian bird flu :rolleyes:
-
I nwant it to be like this, it might be ugly but I hope it shows what I want to show.
-
and not like this
-
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
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
-
Just occurred to me that code might do the curve that you dont want.
-
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.
-
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.
-
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
-
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.
-
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
-
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
-
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...
-
Yaeh, I have no car, so it's me on my bike everywhere I go.
Bike... with the wind in my face...