These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

Issues, Workarounds & Localization

 
  • Topic is locked indefinitely.
 

Pythagorean theorem - Not working. but why?

First post
Author
Hottspitta jR
Knights of Azrael
#1 - 2012-06-01 02:43:55 UTC  |  Edited by: Hottspitta jR
Uber mistake. My apologies.
I want to know why this doesn't work because it is useful to gauge other players distances from objects such as gates. Gate strategy would be easier to achieve had this worked.

Concept for why it wouldn't work and example:
So say me and a friend are reporting the same distance from each-other. 2774m. I want to find how far my friend is from some glacial mass. I am 7663m from the glacial mass.

To find his distance i would do the equation: 2774^2 + 7663^2 = c^2. Obviously solving for C which equals: 8149.640789629933
I ask for his distance and he reports: 6466m
I also did this testing another distance and him being same location: 4555^2 + 1616^ ~ 4833m. So the deviation is not the same and is completely skewed.

I can think of few reasons this would not work:
1# The the contact point on the iceberg where our points hit are not together. (Has to do with how distance is gauged.)
2# The units used for measurement are not accurately sized.
3# A little bit of 1 and 2.

Anyhow if #2 is the reason at all. My guess is you should be able to optimize server performance with such a change.

Uber mistake. My apologies.
CCP Atlas
C C P
C C P Alliance
#2 - 2012-06-01 08:45:29 UTC
You and your friend need to be forming a right triangle with the asteroid for Pythagoras to apply.
Hottspitta jR
Knights of Azrael
#3 - 2012-06-01 11:00:57 UTC  |  Edited by: Hottspitta jR
CCP Atlas wrote:
You and your friend need to be forming a right triangle with the asteroid for Pythagoras to apply.


Yeah i was just about to get to sleep then realized that and quickly logged back on. >.<
Lots of math work, and it slipped through my head. I figured it didn't need to be a right triangle because the triangle with all the angles added up equal 180(brain figured it was obsolete, but then visualized the theorem). I need to stop thinking about stupid things like this when i have have math classes that need more attention. haha

Would you happen to know an equation that solves what i'm looking for?

I was thinking about this because i wanted to write a quick application that would calculate a players position from a specific entity.
Vincent Athena
Photosynth
#4 - 2012-06-01 16:52:26 UTC
Think scan probes: you need 4 to nail down the position of a signal.

If you got several ships and all you know is the distance between each, but the absolute position of none, then you need 5 ships to be able to calculate the relative x, y, z position of each ship relative to the others. Once you got all that, you can use any 4 to get the position of a new target.

Know a Frozen fan? Check this out

Frozen fanfiction

Hottspitta jR
Knights of Azrael
#5 - 2012-06-01 21:41:08 UTC  |  Edited by: Hottspitta jR
I was thinking more along the lines of two sides of the triangle and a degree. Because you only need two lengths and one degree to know a specific size of the missing section. I just became lazy after i botched that up. (The degree between the distances you know.)

I just think this is something useful that should already be implemented in game. However a graphic scanner can be used to calculate the degree of the angle from your ship.... I just got bored and want something constructive to do. lol

This is for visually acquired targets. And i know its something that can help players in certain scenarios.
Zalasastra
Royal Amarr Institute
Amarr Empire
#6 - 2012-06-13 14:18:51 UTC
an issue is that ships are not idealized points and your distance measurements go to the surface of the ship, not its center point, so even if you have the most of the required information you still need to factor in the diameter of your ships as far as the ingame measurements are concerned with their diameters

...unless I'm totally wrong.
CCP Spitfire
C C P
C C P Alliance
#7 - 2012-06-14 12:59:28 UTC
Hottspitta jR wrote:
CCP Atlas wrote:
You and your friend need to be forming a right triangle with the asteroid for Pythagoras to apply.


Yeah i was just about to get to sleep then realized that and quickly logged back on. >.<
Lots of math work, and it slipped through my head. I figured it didn't need to be a right triangle because the triangle with all the angles added up equal 180(brain figured it was obsolete, but then visualized the theorem). I need to stop thinking about stupid things like this when i have have math classes that need more attention. haha

Would you happen to know an equation that solves what i'm looking for?


a^2 + b^2 -2*a*b*cos@ = c^2, where @ is the angle between a and b.

CCP Spitfire | Marketing & Sales Team @ccp_spitfire

Makari Aeron
Imperial Shipment
Amarr Empire
#8 - 2012-06-14 13:34:48 UTC  |  Edited by: Makari Aeron
CCP Spitfire wrote:
Hottspitta jR wrote:
CCP Atlas wrote:
You and your friend need to be forming a right triangle with the asteroid for Pythagoras to apply.


Yeah i was just about to get to sleep then realized that and quickly logged back on. >.<
Lots of math work, and it slipped through my head. I figured it didn't need to be a right triangle because the triangle with all the angles added up equal 180(brain figured it was obsolete, but then visualized the theorem). I need to stop thinking about stupid things like this when i have have math classes that need more attention. haha

Would you happen to know an equation that solves what i'm looking for?


a^2 + b^2 -2*a*b*cos@ = c^2, where @ is the angle between a and b.



TL;DR: good luck with your calculations, that math is going to suck.

You'd be surprised how much the 2*a*b*cos([theta]) will change your answer. The only problem is that there really isn't a tool in EVE for measuring the angle to another player or celestrial from a point in space.

/* START SPECULATION
* NOTE: this next part is entirely speculative, I could be wrong especially since I'm at work with no access to EVE

If you know how many radians per second you are moving from the other player (and you keep it constant), how much time it's been (in seconds) since you left the point in space, and your distance from the point, you and he should be able to calculate the angles between you. (I say angles because it will be based off the line that bisecs the angle between you thus giving you half the angle). Remember, your result will be in radians so you'll probably want to convert it to degrees to help the solution make sense. I refuse to do this math on the grounds that it sucks some major ass and I finished my university math a while ago.
END SPECULATION */

Here's some back calculations to maybe help you with your results:
Equation to find Theta in Degrees
(note: acos = cos^-1; google uses acos and spits it back in radians so you have to convert to degrees)
2774^2 + 7663^2 - 2*2774*7663*cos([theta]) = 6466^2
acos[(2774^2 + 7663^2 - 6466^2) / (2*2774*7663)] = [theta]
Radians to Degrees (r = pi/180 * d): [newTheta] = [theta] * 180/pi
[newTheta] = ~33.16 Degrees

a^2 + b^2 -2*a*b*cos([theta]) = c^2
a^2 + b^2 - c^2 = 2*a*b*cos([theta])
(a^2 + b^2 - c^2) / 2*a*b = cos([theta])
acos[(a^2 + b^2 - c^2) / 2*a*b] = [theta]
Radians to Degrees (r = pi/180 * d): [newTheta] = [theta] * 180/pi

CCP RedDawn: Ugly people are just playing life on HARD mode. Personally, I'm playing on an INFERNO difficulty.

CCP Goliath: I often believe that the best way to get something done is to shout at the person trying to help you. http://goo.gl/PKGDP

Bloodpetal
Tir Capital Management Group
#9 - 2012-06-14 14:34:29 UTC  |  Edited by: Bloodpetal
Distance is calculated from the edge of an object. (think about approaching a station you can be at 0km from both sides of it.)

That adds complication.

#2 you can't know the angle as another has said. (you can guess , but the point of this is accuracy, right?)

Best you can do is get another pOint of reference from an ally and "triangulate".

Where I am.

James Q Farpoint
Deep Core Mining Inc.
Caldari State
#10 - 2012-06-14 15:04:51 UTC
You could convert the distance between your friend and the object on your screen to the actual distance. For that you don't need any angles, but you need to know how far both of them are from you (or more specifically from your camera) and you need to know the projection matrix of the camera (I wonder if CCP could provide that one, but most perspective projection matrices are fairly similar). Then you position you camera very close to your ship and point it at them so that both are visible. With the projection matrix you can recalculate the lines in space along which both should be located (using their position on your screen). Combined with the distance you get their positions in space. Then you can measure their distance.

Of course you can also just ask your friend how far away he is from that object P
CCP Spitfire
C C P
C C P Alliance
#11 - 2012-06-14 15:30:47 UTC
James Q Farpoint wrote:

Of course you can also just ask your friend how far away he is from that object P


And where's the fun in that? Big smile

CCP Spitfire | Marketing & Sales Team @ccp_spitfire

Alberik
Eusebius Corporation
#12 - 2012-06-14 15:39:09 UTC  |  Edited by: Alberik
this will only work if distance is large in relation to the objects radius.

im sitting about 6m elevated from ground floor and presume there are many others with nearly the same elevation but a much longer distance than 12m from me, wich is the maximum the formula would give with an angle of 180°

it will work if you add the radius of the object to both a and b. dont forget to mention you own and you friends radius if they are not small in relation to the estimated distance
James Morgan
Pod Republic
#13 - 2012-06-15 14:27:25 UTC  |  Edited by: James Morgan
It can be done easily. We can work out the distance in the following simple manner

Lets say you are at point A, your friend at point B and the Target(Glacial Mass) at point C

Now you know the length of AB and AC and want to find out the length of BC (your friends distance to glacial mass)
Now you need to move towards the point C for some time(i.e. approach the glacial mass). After covering some distance you can stop your ship, lets call this location as D.

Consider the triangle ABD, you know AB, AD and DB, so there should not be a problem to get the angle DAB. Since you were moving in the direction to point C, D lies on the line AC and hence angle DAB = angle CAB

Now you have angle CAB, AC and AB it should be simple to get the length of BC

For exact formulas you can refer to Wikipedia Triangle page look for Sine, cosine and tangent rules in it
Hottspitta jR
Knights of Azrael
#14 - 2012-06-25 21:57:40 UTC
CCP Spitfire wrote:
James Q Farpoint wrote:

Of course you can also just ask your friend how far away he is from that object P


And where's the fun in that? Big smile


Exactly Big smile

And i doubt the enemy will tell you how far he is from something(Even thought you have all the data in front of you which should tell you and still can't.). But anyhow thanks for the responses. :-)

I originally started out thinking this would be my goal, however it is something truly bigger and this is just a beginning idea.