RHY3756547 wrote:
nXIII wrote:
RHY3756547 wrote:
Woot - I made a pixel perfect position calculator (with the power of simultaneous equations and the Pythagoras Theorem)!
Now to make the robot...How is that possible? You need at least SAS or SSS to do that, and none of them or the others are possible without the banned block. Pythagorean Theorem only works with TWO legs, but you only have one...
Distance to blocks from two sensors at the bottom corners of the screen are all that is needed.
I worked out how to calculate the X and Y position with the rules of simultaneous equations.
But..........................................those quadratics scare me. I don't like 240+-√(-4y^2-1440y-129600)/2 . It's imaginary, so I must be doing something wrong...
Last edited by nXIII (2010-03-09 14:24:55)
Offline
That's close to what I got.
Offline
RHY3756547 wrote:
That's close to what I got.
![]()
WHAT THE?!
Please tell me what you got. I keep getting... imaginary stuff...:
d_1=√( (x-240)^2+(y-180)^2 )
d_2=√( (x+240)^2+(y-180)^2 )
〖d_1〗^2= (x-240)^2+(y-180)^2
(y-180)^2=〖d_1〗^2-(x+240)^2
d_2=√( (x-240)^2+〖d_1〗^2-(x+240)^2 )
〖d_2〗^2= (x-240)^2+〖d_1〗^2-(x+240)^2
〖d_2〗^2=x^2-480x+57600+〖d_1〗^2+x^2+480x+57600
〖d_2〗^2=2x^2+115200+〖d_1〗^2
2x^2=〖d_2〗^2-〖d_1〗^2-115200
x^2= (〖d_2〗^2-〖d_1〗^2-115200)/2
x=√( (〖d_2〗^2-〖d_1〗^2-115200)/2)
But the x always returns imaginary....
QUICK! Before Lucario sees this!
Last edited by nXIII (2010-03-09 14:48:56)
Offline
If I understand right, you keep ending up with x being not a number. Try an absolute value block before square roots?
I'm only in algebra, so I coulda gotten this wrong.
Offline
juststickman wrote:
If I understand right, you keep ending up with x being not a number. Try an absolute value block before square roots?
I'm only in algebra, so I coulda gotten this wrong.
no... that wouldn't return the right number
By the way, it is a number, just not a real one. That's where i comes into play.
RHY3756547 - Please tell me
. I know I'm close, I just don't know what's wrong with it. If I saw what you did, I could fix mine.
Last edited by nXIII (2010-03-09 15:13:18)
Offline
nXIII wrote:
RHY3756547 wrote:
That's close to what I got.
![]()
WHAT THE?!
Please tell me what you got. I keep getting... imaginary stuff...:
d_1=√( (x-240)^2+(y-180)^2 )
d_2=√( (x+240)^2+(y-180)^2 )
〖d_1〗^2= (x-240)^2+(y-180)^2
(y-180)^2=〖d_1〗^2-(x+240)^2
d_2=√( (x-240)^2+〖d_1〗^2-(x+240)^2 )
〖d_2〗^2= (x-240)^2+〖d_1〗^2-(x+240)^2
〖d_2〗^2=x^2-480x+57600+〖d_1〗^2+x^2+480x+57600
〖d_2〗^2=2x^2+115200+〖d_1〗^2
2x^2=〖d_2〗^2-〖d_1〗^2-115200
x^2= (〖d_2〗^2-〖d_1〗^2-115200)/2
x=√( (〖d_2〗^2-〖d_1〗^2-115200)/2)
But the x always returns imaginary....
QUICK! Before Lucario sees this!
I don't understand the way you are writing the equarion with the 〖s etc...
The point is, you don't find x, as that's impossible. You find y from that triangle then use pythagoras to get x.
Offline
RHY3756547 wrote:
nXIII wrote:
RHY3756547 wrote:
That's close to what I got.
![]()
WHAT THE?!
Please tell me what you got. I keep getting... imaginary stuff...:
d_1=√( (x-240)^2+(y-180)^2 )
d_2=√( (x+240)^2+(y-180)^2 )
〖d_1〗^2= (x-240)^2+(y-180)^2
(y-180)^2=〖d_1〗^2-(x+240)^2
d_2=√( (x-240)^2+〖d_1〗^2-(x+240)^2 )
〖d_2〗^2= (x-240)^2+〖d_1〗^2-(x+240)^2
〖d_2〗^2=x^2-480x+57600+〖d_1〗^2+x^2+480x+57600
〖d_2〗^2=2x^2+115200+〖d_1〗^2
2x^2=〖d_2〗^2-〖d_1〗^2-115200
x^2= (〖d_2〗^2-〖d_1〗^2-115200)/2
x=√( (〖d_2〗^2-〖d_1〗^2-115200)/2)
But the x always returns imaginary....
QUICK! Before Lucario sees this!I don't understand the way you are writing the equarion with the 〖s etc...
The point is, you don't find x, as that's impossible. You find y from that triangle then use pythagoras to get x.
Oh... OK. THANKS!
By the way... I apologize for the equation, it looks a lot nicer in MS Word (where I made it)
Offline
urhungry wrote:
can i use pretty much any of the banned blocks on my team? i have written a really well working script, but it requires the use of some of them on my team members.
Yes, you can. You just can't use them for enemy robots/projectiles.
Offline
nXIII wrote:
RHY3756547-
d_1=√( (x-240)^2+(y-180)^2 )
d_2=√( (x+240)^2+(y-180)^2 )
Are these the right equations? (d_1 being the first distance and d_2 being the second)
I have no idea. It isn't near what I got...
Test it out in scratch and see if it reports the right values.
Offline
RHY3756547 wrote:
nXIII wrote:
RHY3756547-
d_1=√( (x-240)^2+(y-180)^2 )
d_2=√( (x+240)^2+(y-180)^2 )
Are these the right equations? (d_1 being the first distance and d_2 being the second)I have no idea. It isn't near what I got...
Test it out in scratch and see if it reports the right values.
Sorry, never mind. i meant base equations, and they were. I got--
[Message removed due to possible information leaks to other users]
Last edited by nXIII (2010-03-09 19:36:37)
Offline
RHY3756547 wrote:
The point is, you don't find x, as that's impossible. You find y from that triangle then use pythagoras to get x.
Which is quite amazing, because I found x and then used pythag on y.
Last edited by nXIII (2010-03-09 19:36:27)
Offline
nXIII wrote:
Demosthenes wrote:
Exception: you may use ([x/y position] of [EnemyProjectile]) only.
But WHY?!
atan of (x/y) of Enemy Projectile can help make you know the direction it's coming from.
Offline
Kileymeister wrote:
nXIII wrote:
Demosthenes wrote:
Exception: you may use ([x/y position] of [EnemyProjectile]) only.
But WHY?!
atan of (x/y) of Enemy Projectile can help make you know the direction it's coming from.
Still - that ruins the fun it finding a way to use algorithms to find the position of the enemy!!!
lol.
Meh, either way, it can be inaccurate, considering that you can have guided missles.
Offline
Lucario621 wrote:
Kileymeister wrote:
nXIII wrote:
But WHY?!atan of (x/y) of Enemy Projectile can help make you know the direction it's coming from.
Still - that ruins the fun it finding a way to use algorithms to find the position of the enemy!!!
lol.
Meh, either way, it can be inaccurate, considering that you can have guided missles.
My PERFECT PIXEL DETECTOR and TRIG USAGE tell me the positions of both the enemy and the projectile AND the direction of the projectile.
Offline
nXIII wrote:
I must clarify...
Projectiles must be HIDDEN when they expire, correct? (not 100%-ghosted, because that still triggers hits)
Yeah.
Offline
fg123 wrote:
You can;t even detect your own xy?
...yes you can. You can detect your x y for any of the sprites that are on your team, and not part of the enemies...
Offline
I know I probably shouldn't be uploading this,but if anyone is having trouble coming up with ideas,here's my engine(and current robot so far) at http://scratch.mit.edu/projects/Brass45/923666. Please tell me if you find any bugs or have any suggestions.Also,this means that i'm officially in the competition(i'll probably get killed in 10 seconds...oh well).
Last edited by Brass45 (2010-03-09 23:24:39)
Offline