|
-
Nov 2nd, 2001, 06:52 AM
#1
SImple, enough. If you have, say, 4 nodes, the first is at 45, the second at 90+45, the third at 180+45, and the fourth at 360-45. Now, to find the coordinates, simple multiply each angle by (pi / 180) to convert to radians, and use this formula:
Code:
p.x = center.x + radius * cos(radianMeasure)
p.y = center .y + radius * sin(radianMeasure)
Where radianMeasure is the degree angle converted to radians, p and center are POINTAPI, radius is, of course, the distance from the center to each node.
I chose to start at 45, because you will then get a nice looking X shape. You should start the count at (angleBetween / 2).
Z.
-
Nov 2nd, 2001, 06:57 AM
#2
Retired VBF Adm1nistrator
Hmmm well the user can do any from 1 up to n hosts. So I would have to start a spoke somewhere, and then each additional spoke is (360 / hosts) degrees away...
uhn I really hate trig stuff. I much prefer proper coding
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Nov 2nd, 2001, 07:32 AM
#3
That's what I am saying. Start the first host at (360 / hosts) / 2, and increase that count by (360 / hosts) each time.
Z.
-
Nov 2nd, 2001, 07:35 AM
#4
Retired VBF Adm1nistrator
You wanna code it for me ?
I'll swap for the tracert+ping code
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Nov 2nd, 2001, 08:16 AM
#5
PowerPoster
Honestly, even the simplest of things elude you!
What he said was:
LengthOfSpoke = (((pi * 42)/6) * AvgNoOfBowelMvmntsThisWeek) + _
centerpoint + ((100/maxping)*pingsize) *cos( ((360/maxnodes)*currentnode)*(pi / 180 ))
Easy innit!
Gentile or Jew,
O you who turn the wheel and look to windward,
Consider Phlebas, who was once handsome and tall as you...
-
Nov 2nd, 2001, 08:36 AM
#6
Good Ol' Platypus
For ease-of-use, use a different coordinate system that has your computer's centre at 0,0. Then for each computer use X = Cos((ComputerNumber / Computers) * 360 * (Pi / 180)) * (length you want it to be away from), and set Y with the Sin() function in the same way.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Nov 2nd, 2001, 09:05 AM
#7
Retired VBF Adm1nistrator
People, im looking for code, not comments
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Nov 2nd, 2001, 09:16 AM
#8
PowerPoster
nodex = centerpoint + ((100/maxping)*pingsize) *cos( ((360/maxnodes)*currentnode)*(pi / 180 ))
nodey = centerpoint + ((100/maxping)*pingsize) *sin( ((360/maxnodes)*currentnode)*(pi / 180 ))
there's some rough maths for you you moaning git! 
Don't know if it works - I've just come back from the pub and maths isn't my strong point anyway. If it's useless and wrong then it's useless and wrong. I don't care....
Gentile or Jew,
O you who turn the wheel and look to windward,
Consider Phlebas, who was once handsome and tall as you...
-
Nov 2nd, 2001, 09:19 AM
#9
Retired VBF Adm1nistrator
Check your email. Don't toy with me right now 
Anyway. I just need some code to copy and paste. I'm in no mood to rub brain cells together. I'm in more of a mood to wet them with a bit of bulmers...
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Nov 2nd, 2001, 09:26 AM
#10
PowerPoster
Not got an eMail yet matey, servers are running slow. Thought you hadn't bothered replying 
The best I can offer is that you put your wotsit on a server somewhere and I'll download it and have a look. I can't post code based on what you've put here...
Gentile or Jew,
O you who turn the wheel and look to windward,
Consider Phlebas, who was once handsome and tall as you...
-
Nov 2nd, 2001, 09:32 AM
#11
Retired VBF Adm1nistrator
www.coolground.com/plenderj/4.zip
it does a tracert to 4 addresses at the moment.
user will be able to tracert to 1 or n hosts.
records all the info.
have to display.
oasidj2sfkop3
p
asjfoi!
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Nov 2nd, 2001, 09:45 AM
#12
PowerPoster
Got your mail and replied now. I'm look at the project as well.
What happened at the bottom of you post? Bang you head against the keyboard?
Gentile or Jew,
O you who turn the wheel and look to windward,
Consider Phlebas, who was once handsome and tall as you...
-
Nov 2nd, 2001, 09:48 AM
#13
Retired VBF Adm1nistrator
bout of rage.
got some groove armada (at the river) on at the minute, so its all good.
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Nov 2nd, 2001, 09:57 AM
#14
PowerPoster
Ok, I've looked at that project and it seems to get in an infinite loop. The sHostIP never changes and as it's being compared at one point to get out of the loop - it never makes it.
Is this just me being thick?
Gentile or Jew,
O you who turn the wheel and look to windward,
Consider Phlebas, who was once handsome and tall as you...
-
Nov 2nd, 2001, 11:03 AM
#15
Retired VBF Adm1nistrator
Its you being thick.
tracert works ; trust me. its complicated.
just do the trig
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Nov 2nd, 2001, 11:06 AM
#16
PowerPoster
I'm struggling with it because I can't test it because it doesn't work.
I'll try it at home where I can look at it without being hidden behind all the complicated network ****e and I can get some ping values back.
Speak to you in an hour or so.
Gentile or Jew,
O you who turn the wheel and look to windward,
Consider Phlebas, who was once handsome and tall as you...
-
Nov 2nd, 2001, 04:49 PM
#17
transcendental analytic
Holy crap jamie, you don't know euler transformation?
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Nov 2nd, 2001, 06:04 PM
#18
Frenzied Member
D*MN!!! It ate my post! I spent the last half an hour writing it 
Ok so I'm gonna post here just the code. And this one I'm sure it works 
VB Code:
Angle = (Pi * 2 * Host) / NumHosts
HostX = CircleX + Cos(Angle) * CircleRadius
HostY = CircleY + Sin(Angle) * CircleRadius
Let's see... Pi is obviously 3.1415926..., Host is the number of the host you're drawing, NumHosts is the number of hosts, CircleX/Y is the center of the "circle of hosts", and CircleRadius is the radius of that circle.
Hope that helps!
-
Nov 4th, 2001, 06:20 AM
#19
Retired VBF Adm1nistrator
This is kinda what im after.
Each circle on the way is each router on the route ...
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Nov 4th, 2001, 06:53 AM
#20
transcendental analytic
you can define a complex offset unit to traverse the rotation
Cu=1*e^j2pi/n
and for each singly likned node shown in your figure, increment by Cu*Cn
Cn=u*ping*e^j0
These are polar representation of complex values, the transformation to cartesian is:
r*e^(j*theta)=cos(theta)+jsin(theta)
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Nov 4th, 2001, 06:58 AM
#21
Retired VBF Adm1nistrator
Christ almighty. All I want is a .frm given to me that'll do the job
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Nov 4th, 2001, 07:01 AM
#22
transcendental analytic
jamie, you should learn this immediately, it'll be good for you Does the routes split up?
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Nov 4th, 2001, 11:52 AM
#23
Frenzied Member
Sorry but I don't know much about routes and all 
Do these things branch out into others, like a tree?
-
Nov 5th, 2001, 02:28 AM
#24
PowerPoster
Jamie,
I fail to see what's wrong with the calculations that Jotaf and I posted. They're both pretty similar (mine's not been tested though) but in Jotaf's I guess you'd replace "radius" with the server ping.
PS - I completely fail to see what Kedaman's on about at all. No change there then.
I think I need to buy some more IQ.
Gentile or Jew,
O you who turn the wheel and look to windward,
Consider Phlebas, who was once handsome and tall as you...
-
Nov 5th, 2001, 03:15 AM
#25
Retired VBF Adm1nistrator
Ked; No the routes dont split. Just a straight line out at an angle with the nodes along the route along that line.
Rest; I dont wanna do no work. I'm anti-trig. I need a .frm
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Nov 5th, 2001, 04:17 AM
#26
transcendental analytic
If you use complex values you avoid trigs at almost all costs, eulers formula is unavoidable though, but without it you are no programmer.
Jamie, you learn Trigs at 7'th year or something in basic school here, how come you've avoided them so far? No, you won't survive without them further on.
PS - I completely fail to see what Kedaman's on about at all. No change there then.
Complex values have two faces, they are both polar and cartesian, which makes them an excellent tool You can though use trigonometry all the time for some transformation, but complex values enhance your generic thinking and makes it easier for you, when you have to do a long series you might win both runtime performance and developement time.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Nov 5th, 2001, 04:33 AM
#27
Retired VBF Adm1nistrator
I studied complex numbers and polar co-ordinates and all that about 3 years ago. Since then the only time I needed trig was for Craft and I finished the trig part of that ages ago
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Nov 5th, 2001, 06:37 AM
#28
PowerPoster
Sent you an frm with some **** in.
Can't test it 'cos your shoddy code doesn't work properly. It may end up drawing the images completely off the screen - you'll have to step through in a debug to see what it does.
It never gets to that point on mine, it just goes into an endless loop. Don't complain if it doesn't work, because coding trig blind is insane and is guaranteed not to work first time.
Gentile or Jew,
O you who turn the wheel and look to windward,
Consider Phlebas, who was once handsome and tall as you...
-
Nov 5th, 2001, 06:41 AM
#29
Retired VBF Adm1nistrator
Well the tracert works for me 
Anyway yeah its drawing stuff all in the centre...
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Nov 5th, 2001, 06:44 AM
#30
Retired VBF Adm1nistrator
Hmm the code kinda works. It does draw stuff (we're drawing otherNode.hdc btw). Anyway, it only draws the destination node, not the nodes inbetween...
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Nov 5th, 2001, 06:53 AM
#31
PowerPoster
Are you pinging all the servers inbetween?
If so, and you're storing the ping values in an array then you can easily get it to draw the ones inbetween.
That just loops through the troute wotsit array. If there are other gubbins then just add them in.
I'll take another look and see if I missed anything. It's rather hard, not being able to see what I'm doing and all...
Gentile or Jew,
O you who turn the wheel and look to windward,
Consider Phlebas, who was once handsome and tall as you...
-
Nov 5th, 2001, 06:54 AM
#32
PowerPoster
What's dis hoptime thing for?
Gentile or Jew,
O you who turn the wheel and look to windward,
Consider Phlebas, who was once handsome and tall as you...
-
Nov 5th, 2001, 06:59 AM
#33
Retired VBF Adm1nistrator
The hoptime is the time to that node. Thats also gonna be the distance between nodes
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Nov 5th, 2001, 07:04 AM
#34
PowerPoster
right, gissa mo and I'll send you something else
Gentile or Jew,
O you who turn the wheel and look to windward,
Consider Phlebas, who was once handsome and tall as you...
-
Nov 5th, 2001, 07:16 AM
#35
PowerPoster
Sent you some porn in your eMail.
Gentile or Jew,
O you who turn the wheel and look to windward,
Consider Phlebas, who was once handsome and tall as you...
-
Nov 5th, 2001, 09:00 AM
#36
Retired VBF Adm1nistrator
u didnt send me natin but text
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Nov 5th, 2001, 10:00 AM
#37
PowerPoster
Gentile or Jew,
O you who turn the wheel and look to windward,
Consider Phlebas, who was once handsome and tall as you...
-
Nov 5th, 2001, 10:02 AM
#38
Retired VBF Adm1nistrator
i only got the first one from you.
... keep talking, im nearly at 4096
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Nov 5th, 2001, 10:09 AM
#39
PowerPoster
Idiot boy!
I sent you another .frm with different code.
Gentile or Jew,
O you who turn the wheel and look to windward,
Consider Phlebas, who was once handsome and tall as you...
-
Nov 5th, 2001, 10:28 AM
#40
Retired VBF Adm1nistrator
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|