Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
xDist = bX - aX
yDist = bY - aY
sqrt((xDist ^ 2) + (yDist ^ 2))
Thanks for the anwer GrumpyOldman but I meant in Stormworks. I know the formula you gave, which is right ... but this would give us the distance in pixel.
I want to know in KM in the game world. Is a pixel 1 meters, 5 meters or 50 meters.
Briefly, what would be the distance in meter between two points.
What would be the distance in meter of (0,0) to (0,1)?
((a-x)^2+(b-y)^2)^(1/2)/1000
The formula above would give distance in km because I divided by 1000
otherwise, it's distance in meters. The map in stormworks states x,y in terms of meters, not pixels.
In my application, (a,b) are the x,y points provided by a GPS unit (my current position) and (x,y) are just any x,y points I want to measure my distance from.
However, in fairness to Grumpy... it's the same exact formula he provided. I just copy/pasted it directly from the formula input in my logic editor.
Yeah thanks guys I do get it now. So the unit is in meters.
Thanks a lot. That clarified the ole thing. :)
I don't *think* that shortcut ports to LUA. So I would stick to the pure math operators.