Code center > Suggestions
I am back...
Numsgil:
I can make my own code for it, It'd just be nice if you do the actual research for me.
Just post an equation.
You know, not code. Math.
I'm a math major, I read and think in math, not code. Don't post code. Post an equation. I'm being really really clear on this point because if you post code I won't be able to use it. I don't read code, I read equations. Am I being clear enough? Forgive me if this seems overboard, I'm just trying to be sure there's no misunderstanding.
Botsareus:
To post gunior high level math I first how to write code to make sure it works, (thats how I do research XD)
meanwhile:
2. A way to find the distance of a bot to the nearest in bounds point, as well as what that point is.
What do you mean?
Numsgil:
For the second point: in non torroidal modes, bots are pushed towards the nearest in bounds point.
For instance:
--- Code: --- |
|
|
|_________
A
--- End code ---
Pretend the A above is a point. The nearest in bounds point is that corner of the box. In an ovoid field, I'll need a way to find the nearest in bounds point as well.
You know, instead of reinventing the wheel you could just do some research on wikipedia into ellipses and their equations.
Botsareus:
1. too far in one direction = ((feildwith/2 - X) ^ 2 + ((feildHeight / 2 - Y) / feildHeight * feildWidth) ^ 2) ^ 0.5 > feildwith/2
might need simplification!? hope not...
and since 2. is practicaly the same problem based on the 'info...' problem solved.
Numsgil:
--- Quote ---1. too far in one direction = ((feildwith/2 - X) ^ 2 + ((feildHeight / 2 - Y) / feildHeight * feildWidth) ^ 2) ^ 0.5 > feildwith/2
might need simplification!? hope not...
--- End quote ---
Could use some explanation.
Remember what I asked for. I need a way to determine if a point is out of bounds, and if it is, where to respawn it.
((feildwith/2 - X) ^ 2 + ((feildHeight / 2 - Y) / feildHeight * feildWidth) ^ 2) ^ 0.5 > feildwith/2
seems to be an inequality, and therefore may tell me if a point is out of bounds (haven't checked it yet) but can't tell me where to respawn it.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version