A list of puns related to "Great circle distance"
Hi guys for my project im trynna get the angular difference between two rotational vctors. the vctors are usually -90-90, -180-180, 0 with the z axis always the same.
thats^ minus ninety to ninety btw. and minus 180 to eighty...
The angles is herefore longitude and latitude thus far.
yeah anyway its basically the roational directions of the camera, up/down, leftright.
link to wikipedia https://en.wikipedia.org/wiki/Rotation_matrix
um anyway yeah if basically you guys could come up with an equation lets use the values initial and ending in the angles to come up with an equation that would be right quite goodetc and i quickly could use that equation inmy projectetc. thanks guys amen
When the distance between two points on earth grow large, the euclidean Law of Cosines,
cΒ² = aΒ² + bΒ² - (2ab)cos(C)
becomes an inadequate tool to estimate the distance. Instead, navigators and surveyors use a variation of the Spherical Law of Cosines,
cos(c) = cos(a)cos(b) + sin(a)sin(b)cos(C)
called the Law of Haversines,
hav(c) = hav(a-b) + sin(a)sin(b)hav(C)
Where havΞΈ = [1 - cosΞΈ]/2
We begin by converting spherical coordinates to cartesian coordinates.
(x, y, z) = (r, Ο, Ξ») = (radius, altitude, azimuth)
Using typical spherical coordinates, the following applies: r β₯ 0 0Β° β€ Ο β€ 180Β° 0Β° β€ Ξ» < 360Β°
x = rsin(Ο)cos(Ξ») = radial component along x-axis y = rsin(Ο)sin(Ξ») = altitude component along the y-axis z = rcos(Ο) = azimuth component alone the z-axis
On a globe, latitude coordinates are flipped 90Β°, so we just subtract Ο from 90, giving us the following:
x = rsin(90-Ο)cos(Ξ») = rcosΟcosΞ» y = rsin(90-Ο)sin(Ξ») = rcosΟsinΞ» z = rcos(90-Ο) = rsinΞ»
So now, our coordinates are:
x = rcosΟcosΞ» y = rcosΟsinΞ» z = rsinΞ»
This will result in a slightly different version of the Law of Haversines from the one presented above.
Equation for a sphere:
dΒ² = (xβ - xβ)Β² + (yβ - yβ)Β² + (zβ - zβ)Β²
dΒ² = [rcos(Οβ)cos(Ξ»β) - rcos(Οβ)cos(Ξ»β)]Β² + [rcos(Οβ)sin(Ξ»β) - rcos(Οβ)sin(Ξ»β)]Β² + [rsin(Οβ) - rsin(Οβ)]Β²
We can factor out r and bring it the left side:
(d/r)Β² = [cos(Οβ)cos(Ξ»β) - cos(Οβ)cos(Ξ»β)]Β² + [cos(Οβ)sin(Ξ»β) - cos(Οβ)sin(Ξ»β)]Β² + [sin(Οβ) - sin(Οβ)]Β²
X Component
(xβ - xβ)Β² = [cos(Οβ)cos(Ξ»β) - cos(Οβ)cos(Ξ»β)]Β²
= cosΒ²(Οβ)cosΒ²(Ξ»β) - 2cos(Οβ)cos(Ξ»β)cos(Οβ)cos(Ξ»β) + cosΒ²(Οβ)cosΒ²(Ξ»β)
Y Component
(yβ - yβ)Β² = [cos(Οβ)sin(Ξ»β) - cos(Οβ)sin(Ξ»β)]Β² = cosΒ²(Οβ)sinΒ²(Ξ»β) - 2cos(Οβ)sin(Ξ»β)cos(Οβ)sin(Ξ»β) + cosΒ²(Οβ)sinΒ²(Ξ»β)
Z Component
(zβ - zβ)Β² = [sin(Οβ) - sin(Οβ)]Β² = sinΒ²(Οβ) - 2sin(Οβ)sin(Οβ) + sinΒ²(Οβ)
(d/r)Β² = (xβ - xβ)Β² + (yβ - yβ)Β² + (zβ - zβ)Β²
= cosΒ²(Οβ)cosΒ²(Ξ»β) - 2cos(Οβ)cos(Ξ»β)cos(Οβ)cos(Ξ»β) + cosΒ²(Οβ)cosΒ²(Ξ»β) + cosΒ²(Οβ)sinΒ²(Ξ»β) - 2cos(Οβ)sin(Ξ»β)cos(Οβ)sin(Ξ»β) + cosΒ²(Οβ)sinΒ²(Ξ»β) + sinΒ²(Οβ) - 2sin(Οβ)sin(Οβ) + sinΒ²(Οβ)
Next, collect terms:
cosΒ²(Οβ)cosΒ²(Ξ»β) + cosΒ²(Οβ)sinΒ²(Ξ»β) + cosΒ²(Οβ)cosΒ²(Ξ»β) + cosΒ²(Οβ)sinΒ²(Ξ»β) + sinΒ²(Οβ) + sinΒ²(Οβ)
Simplify the equation by arranging the terms and identifying Trig Identities:
cosΒ²(Οβ)cosΒ²(Ξ»β) + cosΒ²(Οβ)sinΒ²(Ξ»β) + cosΒ²(Οβ)cosΒ²(Ξ»β) + cosΒ²(Οβ)sinΒ²(Ξ»β) + sinΒ²(
... keep reading on reddit β‘Imagine that you are on a planet of unknown radius.
β’ You have an alien surveying device that provides you the three distances to three radio beacons from your current position.
β’ You know the radio beacons are stationary and are all within Ο/8 radians of each other in terms of the great circle distance.
β’ However, the alien surveying device provides the distance from your position to the beacons in an unknown unit of measure.
β’ Visibility on the planet is very low, and you have no means to determine the precise angle between the headings towards two beacons from your position, nor do you have a compass of any kind.
β’ You can tell when you are exactly facing one of the beacons, such that you may walk towards it.
β’ You also have the ability to place up to three of your own radio beacons down. The distances to these will then also be shown by the alien surveying device.
β’ You have enough battery life to take one reading at each of the six radio beacons (the three that already exist, and the three that you may place down).
Given this situation, is it possible to determine the radius of the sphere upon which the beacons are placed, in terms of the unknown alien measurement units? If so, how?
Further, is it possible to determine geographic coordinates for the beacon points, assuming one of them is the North Pole and one of them is along the Prime Meridian, and you know which ones those ones are? If so, how? How would you do this in spherical coordinates rather than geographic coordinates?
Assume the planet is a perfect sphere.
Note: I am not a student. This is a question related to a virtual/game environment that simulates planets of random sizes that you explore with only the above limitations. I'm trying to devise a way to take measurements and produce a map from this.
As a side note, I'm not actually a math student. Just somebody who forgot how to do all this awhile ago and suddenly needs to calculate some distances for a forum game.
I am trying to make a spreadsheet which can take two coordinates and spit out a distance in kilometers. The complication arises because instead of using standard longitude and latitude coordinates (degrees and such) for this particular purpose I'm using coordinates based on pixels. The (fictional) flat map I'm using to represent the globe is a 100x100 pixel grid and square cylindrical projection (https://media.wired.com/photos/59333555d80dd005b42b165b/master/w_440,c_limit/Equirectangular_projection_400.jpg that map compressed lengthwise to a square). My problem is then taking two pixel coordinates and generating great circle distance between them.
For reference, the map itself along with the grid coordinates is here: http://imgur.com/sSgrqaP.png
My initial attempt was this: https://gyazo.com/f72ea7537e8a5291e9d4002373f450bc.png
I basically pasted in the formula I found on Wikipedia and then multiplied the angle by the ratio of the total circumference according to the formula (tau * 100) to the actual circumference of the earth (40075 km) and multiplied it by 200 (for some reason that last step was necessary to give me the half circumference for plugging in 0, 0 and 50, 0). (Note: Over the course of writing this post, I realized this was incorrect because The half circumference could only be given between 50.5, 0 and 50.5, 50.5. After removing the arbitrary inflation of 200 though, the problem below still arises.)
The problem then arose when I plugged in the distance between 0, 0 and 50, 50. This returned 0 and I don't know why.
At that point I checked my formula a few times and checked everything. I never really learned how to do this in school and due to the relative uniqueness of the problem I couldn't find any help online. Hopefully the problem makes some amount of sense (it may be better phrased as finding great circle distance given coordinates on a cylindrical projection), although I myself had trouble phrasing it. I'd like to know what the formula is but help deriving it is also beneficial
Thanks in advance for any help.
Suppose we know the longitudes/latitudes of two points p1 (-104.673178,39.861656), p2 (-87.904842, 41.978603), we want to find the coordinates of P3 which is 100Km away from the great circle determined by p1 and p2. It is also required that the closest point in the great circle to p3 is p2.
Here is my way to find p3:
First use finalBearing function to find the final bearing of the great circle at p2.
fbearing=finalBearing(p1,p2,sphere=TRUE)
fbearing=139.4564
Because the closest point in the great circle to p3 is p2, angle p3-p2-p1 should equal to 90 degree (is it true?). We can then use destPoint to find p3
p3=destPoint(p2,-(180-fbearing)-90,100*1000,r=6378137,sphere=TRUE)
p3=(-105.555,39.27437)
However, when I use dist2gc to calculate the distance between a point and a great circle
dist2gc(p1, p2, p3, r=R)
The answer is -100106.4, not -100000.
Is my way to find p3 wrong ? Or is 106 meter is acceptable error?
The link of geosphere package: https://cran.r-project.org/web/packages/geosphere/geosphere.pdf
With each new ship I make (and I'm still only making ships or the occasional high altitude "floating fortress" style platforms) I spend more and more time on the AI, but its getting to the point where I'm tempted to set up extremely complex AI behaviors for every ship to maximize efficiency, tweaking every single knob the game gives me so to speak. Getting perfectly stable and smooth movements, changing behavior of maneuvers and weapons depending on what type of enemy I'm facing, and so on.
The problem is that I don't actually like tweaking AI. I like tweaking guns, armor, and speed. And I feel like if I waste too much time I will get burned out on the game quickly. But the default AI feels really mediocre sometimes and its a shame to spend all the time on a nice ship only for it to wobble about all over the place and perform unimpressively in combat due to having basic AI. Also it's weird having some ships with super smart AI and some ships with basic AI, I would rather have my entire fleet optimized, or none of it. So I'm just curious what most people do. Maybe I should just create some computer prefabs to just copy and paste on every ship?
Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.