Data Realms Fan Forums http://45.55.195.193/ |
|
Double Origin Graphing http://45.55.195.193/viewtopic.php?f=7&t=18478 |
Page 1 of 2 |
Author: | Geti [ Thu Apr 15, 2010 6:23 am ] |
Post subject: | Double Origin Graphing |
I graphed a = 2b: So I was in a lecture about maths a few days ago and heard about these wacky things called Double Origin Graphs, where there are two origins (funnily enough) and each point on the graph is defined by the angle between each point (eg 1,2) would be a point 1 rad from origin 1 and 2 rads from origin 2. "linear functions" in this coordinate system are to the form a = nb+c, where a is angle from O1, b is angle from O2, n is any real number and c is a constant (also any real number), and come out as crazy patterns. Anyway, I decided to create something to draw graphs for double origin coordiant systems. Currently this project doesnt do recursion (and it should, as the graphs get way more funky as the revolutions tick on), or constants (which it also should, but i was neglectful). It graphs a function not as a line but as a cloud. I did this because drawing lines is for pansies and real men like their graphs with a healthy spattering of dithered neon glow, but mostly cause line drawing wasn't working , and it looked cooler this way anyway. Oh yeah, drawing is broken when O2 is under and to the left of O1. You'll get a nice black area between them. Anyone wanting to get recursion going, fix the draw function or put in a line drawing mode, be my guest. EDIT: oh yeah, quick note, there's no real text editing (read: no backspace) and I didn't put error handling in. don't try and go ahead with NaNs in the fields, it doesn't like that. YOU WILL NEED LOVE TO RUN THIS! GO AND GET IT FROM LOVE2D.ORG! I'm posting this here cause I figure you're nerds and know lua and a fair bit of maths, so you might want to have a look. The less inquisitive might just like the pictures it makes. Either way, enjoy. EDIT NEW VERSION: a = 5b, 100 recursions at a slight rotation if i remember correctly Now it actually does what it's meant to rather than creating crazy bloomy things, but I'll leave the other one there for those that want a toy. http://drop.io/doubleorigin |
Author: | Daman [ Thu Apr 15, 2010 12:06 pm ] |
Post subject: | Re: Double Origin Graphing |
what. so an entire sector of the graph isn't working? that is a pretty big discrepancy also if you used C++ & SDL it'd be a thousand times faster |
Author: | Geti [ Thu Apr 15, 2010 12:14 pm ] |
Post subject: | Re: Double Origin Graphing |
Indeed it would. It would also take me longer to work out the bugs and I wouldn't have been able to make it in as short a time as I did. also it isnt an entire sector. it draws fine for every other orientation of the two origins (afaik). Still, feel free to debug or tweak. I'm just showing what I could do with some (wasted ) spare time in the afternoon after hearing about these things a few days ago. I'd be keen to see what someone with a heck of a lot more experience than me could do with it, in particular the recursion (with angles larger than 2pi rads being used), which is the main missing feature. |
Author: | alphagamer774 [ Fri Apr 16, 2010 3:20 am ] |
Post subject: | Re: Double Origin Graphing |
That REALLY looks like an invisible high powered laser weapon was fired at the upper left hand corner... |
Author: | FuzzyMelon [ Fri Apr 16, 2010 3:54 am ] |
Post subject: | Re: Double Origin Graphing |
alphagamer774 wrote: That REALLY looks like an invisible high powered laser weapon was fired at the upper left hand corner... That's exactly what I was thinking! It's like the covenant energy sword! |
Author: | Geti [ Fri Apr 16, 2010 4:58 am ] |
Post subject: | Re: Double Origin Graphing |
So wait, it looks like something... invisible? I am confuse. Daman have you had a look at it or were you just hassling my lack of compiled language? |
Author: | FuzzyMelon [ Fri Apr 16, 2010 5:10 am ] |
Post subject: | Re: Double Origin Graphing |
@ geti - well the blade portion does. I'm algebra literate so I contributed the only way i knew how: piggy back style. edit: illiterate |
Author: | Geti [ Fri Apr 16, 2010 8:49 am ] |
Post subject: | Re: Double Origin Graphing |
It was intended more at alpha than you, but fair enough in any case. I might construct a more verbose explanation of what it actually is in a while. |
Author: | Daman [ Fri Apr 16, 2010 1:50 pm ] |
Post subject: | Re: Double Origin Graphing |
yeah actually I was going to re-code it in SDL really quick after I checked it out but I haven't even touched it yet but before even looking at it Quote: each point on the graph is defined by the angle between each point how does this make any sense how is an angle going to define distance with the coordinates (pi, 2pi) do you mean it'd be pi distance from point 1(in what direction?) and 2pi distance from origin 2? would it be multiple points as there are more than one point that are those distances from the origins? actually now that I think about it you probably mean bipolar graphing? what you're talking about sounds a lot like it |
Author: | Geti [ Sat Apr 17, 2010 1:55 am ] |
Post subject: | Re: Double Origin Graphing |
Nope, just angles. Quick, dirty explanation. Each coordinate is defined by the angles made by the line to the point from each origin. in order to do recursion, you'd need to do it the real way, and calculate the x and y coordinates for each point where the function is true rather than calculating how true it is for each x and y value (the way it's currently doing it) |
Author: | Dr. Evil [ Sat Apr 17, 2010 3:48 am ] |
Post subject: | Re: Double Origin Graphing |
That... Is really cool. Son, I am Impress. |
Author: | Geti [ Sat Apr 17, 2010 7:36 am ] |
Post subject: | Re: Double Origin Graphing |
Quick edit to fix a segfault on OSX, caused by trying to edit out of bounds imagedata, because I made assumptions about the way love handled image data (origin was treated as 1,1 rather than 0,0 because lua starts at 1 for most things. general negligence). No other changes though. Glad you like it Dr. Evil. |
Author: | alphagamer774 [ Sun Apr 18, 2010 6:52 pm ] |
Post subject: | Re: Double Origin Graphing |
Well, I really couldn't give less of a ♥♥♥♥ about it's application in mathematics, but this is as cool as fractals when it comes to pictures! |
Author: | Daman [ Thu Apr 22, 2010 9:39 pm ] |
Post subject: | Re: Double Origin Graphing |
Geti wrote: Nope, just angles. Quick, dirty explanation. Each coordinate is defined by the angles made by the line to the point from each origin. in order to do recursion, you'd need to do it the real way, and calculate the x and y coordinates for each point where the function is true rather than calculating how true it is for each x and y value (the way it's currently doing it) That still doesn't make any sense. Are you saying it's just drawing a line starting at each origin, and the point is where the lines drawn by those two angles/origins intersect? How would recursion come into play at all? Adding 2pi to either angle? |
Author: | Geti [ Fri Apr 23, 2010 7:28 am ] |
Post subject: | Re: Double Origin Graphing |
no, recursion is also doing it for angles >2pi, for example 12 and 6 rads would also be a point. Yes it is essentially graphing a huge series of intersections. It makes a huge difference to the product, especially for polynomial etc equations. |
Page 1 of 2 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |