Lakes Posted August 14, 2006 Share Posted August 14, 2006 Well I will try to explain what I think is the math behind this. Its actually pretty simple if you think about it. The main functions that describe the drawing are basically the parametric equations. x( R ) = sin(R*inumber)*(picsize) + constantandy( R ) = cos(R*inumber)*(picsize) + constantThe equations of a circle in parametric style isx(t) = sin(t) and y(t) = cos(t)The difference between these functions is a matter of multiples and constants.The pic size value increases with every iteration and accounts for the increasing radius of the drawing. (The spiral effect)The @desktopwidth/2 and @desktophieght/2 account for centering the image on the screen.The only reason every one does not look look like a circle is because the step value is very large. If you changed the step to an infintecimal number than it would make a spiral or at least part of arc every time. The reason for the odd shapes is that since your facts R and t are not factors of pi (3.14...) the points are always offset.The number of degrees between the points of the line segmant traverses every step is found witht he conversion, (if stepsize is over 180 then subtract as many 360's as needed until you get a number between -180 and 180).Stepsize = (R*180)/pii.e.for R=22*180/pi = 114 degrees step size for R=3 171 degR=4229 deg, however effectivly this is -131 degR=5286 deg (effectively -76 deg)Now we get to the "spiral one"R=6344 deg (effectivly -16 degrees)Well this is the small step value that we want, and it produces a fairly good semblance of a smooth curve especially with the picsize incremenet added in.A few quick calculations how that R = 19 would most likely be a good spiral too. (8 deg step)Well that about does the explanation.I assume the writer of this understood most of this.If anyone has anymore q's id be happy to try to answer them, I like math and stuff like this intrigues me.EDIT: Made the paren R paren into ® and I fixed it.Good Explaination! 2015 - Still no flying cars, instead blankets with sleeves. Link to comment Share on other sites More sharing options...
CoePSX Posted August 14, 2006 Author Share Posted August 14, 2006 -= Code updated =- Now the number on the upleft corner of the screen is the number of degrees of the offset. Thanks to Wus it's now correct. [quote name='Valik' post='301213' date='Jan 31 2007, 10:36 PM']You seem to have a habit of putting things in the wrong place. I feel sorry for any female you attempt to have sex with.[/quote][font="Lucida Sans Unicode"]╔══════════════════════════════╗║░░██░░░░░░░░██░░███░░░████░░░█║║░█░░█░░██░░█░░█░█░░█░█░░░░█░█░║║░█░░░░█░░█░████░███░░░██░░░█░░║║░█░░█░█░░█░█░░░░█░░░░░░░█░█░█░║║░░██░░░██░░░██░░█░░░░███░█░░░█║╚══════════════════════════════╝[/font] Link to comment Share on other sites More sharing options...
fisofo Posted August 14, 2006 Share Posted August 14, 2006 Replace the Sine with a Tangent, there are some interesting designs from that too (albeit not symmetric) Link to comment Share on other sites More sharing options...
CoePSX Posted August 15, 2006 Author Share Posted August 15, 2006 Thanks to Wus clarifing it to me, I was able to calculate the number ofrendered spirals and (on most cases) color each one with a diferent color.And thanks to Lakes the drawing isn't flicky anymore.The code is posted on a new topic called MathMagic Screensaver.http://www.autoitscript.com/forum/index.php?showtopic=30976 [quote name='Valik' post='301213' date='Jan 31 2007, 10:36 PM']You seem to have a habit of putting things in the wrong place. I feel sorry for any female you attempt to have sex with.[/quote][font="Lucida Sans Unicode"]╔══════════════════════════════╗║░░██░░░░░░░░██░░███░░░████░░░█║║░█░░█░░██░░█░░█░█░░█░█░░░░█░█░║║░█░░░░█░░█░████░███░░░██░░░█░░║║░█░░█░█░░█░█░░░░█░░░░░░░█░█░█░║║░░██░░░██░░░██░░█░░░░███░█░░░█║╚══════════════════════════════╝[/font] Link to comment Share on other sites More sharing options...
Adam1213 Posted April 19, 2007 Share Posted April 19, 2007 I was playing around with Sin and Cos, and i started to get patterns of mousemoves when changingthe value multiplied by the number before calculate Sin and Cos.I'm not sure why this happens, I only know it's fun!.Just test it and you'll see the magic of this. I even made it draw in CorelDraw and the details wereamazing.Compiled .SCR file with source code in the zip file.Its so good, i suggest you submit it to downloads.It would be good if it was possible to have the gui to mess with the settings while seeing the cool screensaver IRC Client - 75 pages 3728 lines. Blob crumbler (game)Backup (drag to backup + cmd line)RS232 Link to comment Share on other sites More sharing options...
therks Posted April 19, 2007 Share Posted April 19, 2007 (edited) Wow, older thread.I never saw this thread it's first time around, almost wish I had, it would have made writing my own screensaver a little easier I think. I created this using sin and cos and a bunch of randomness. Compiled script (as .scr) along with full source and everything in the .zip. If you just extract everything to the same dir, and run Scribbler_Draw.au3 you should get a good idea of what it does.http://www.therks.com/autoit/Scribbler.zip Edited April 19, 2007 by Saunders My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now