flat assembler
Message board for the users of flat assembler.

 Index > Heap > Numerical oddities Goto page Previous  1, 2, 3 ... 23, 24, 25, 26  Next
Author
bitRAKE

Joined: 21 Jul 2003
Posts: 2915
Location: [RSP+8*5]
bitRAKE
Question comes to mind though: does the return latitude pass through the diameter of the start circle? Obviously, it passes through the center.
31 May 2013, 09:25
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 17284
revolution
bitRAKE wrote:
I used numerical integration method.

0.00159155007810710868 %
Code:
```;...
..a  dq 6378136.6 ; major (equatorial) and
..b  dq 6356751.9 ; minor (polar) radii of approximate Earth oblique spheroid    ```
I get a different value than your result. But I was working from a different set of values for a and b

But even when I use your values I still get a different value. I didn't use any approximating algorithm, just basic trigonometry.

However I will accept your answer because you are using the right idea to obtain the answer. The actual details of the answer, and the correct value itself, are not important here. I am mostly concerned with the methods and procedures needed.

So, on to the next part of the puzzle:

After beating the odds the man has returned precisely to the starting point. Now he walks 10km due North. Turns right and walks 10km due East. Turns right again and walks 10km due South.
a) If measuring the shortest possible route how far is the man from the starting point?
b) If the man follows a direct line towards the starting point how far will the man have to walk to reach the starting point?
c) In what direction must the man walk to follow a direct path to the starting point?
31 May 2013, 09:39
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 17284
revolution
bitRAKE wrote:
Question comes to mind though: does the return latitude pass through the diameter of the start circle?
No. It is a curve.
31 May 2013, 09:42
tthsqe

Joined: 20 May 2009
Posts: 729
tthsqe
Quote:
However I will accept your answer because you are using the right idea to obtain the answer. The actual details of the answer, and the correct value itself, are not important here. I am mostly concerned with the methods and procedures needed.

This does not make me happy. In the end, it really does come down to numbers, and if the answer is given approximately, I need to know how many digits are claimed to be correct. If the significant part of bitrake's answer is the same as 0.5/(10^4*Pi) or the answer obtained from the sphere case, then it is not useful.
Since we all have calculators, the best way to give an answer is in terms of well-known mathematical functions.

You said that you disagreed slightly with my solution for the case of a perfect sphere. Can you tell me which step is wrong? (it's a different method but gives the same answer as I originally posted)
Code:
```;(* we have a sphere parameterized as *)
x == r Sin[PHI] Cos[TH];
y == r Sin[PHI] Sin[TH];
z == r Cos[PHI];
;(* nominal radius of the earth *)
r = 6371 10^3;
;(* distance man walks to and from the south pole, i'm actually using north pole here but it doesn't matter *)
d1 = 10^4;
;(* distance from starting point man is alowed to return *)
d2 = 1/2;
;(* this gives the distance between two points on the sphere *)
d[phi1_, th1_, phi2_, th2_] :=  r ArcCos[Cos[phi1] Cos[phi2] + Cos[th1 - th2] Sin[phi1] Sin[phi2]];
;(* wlog the man starts at coordinates (PHI,TH) = (d1/r,0) and ends up at coordinates (PHI,TH)=(d1/r,th) *)
;(* lets find th so that the distance is d2 *)
th = (th /. Solve[d[d1/r, 0, d1/r, th] == d2, th][[2]] /. C[1] -> 0);
;(* probability *)
N[th/Pi, 100]
0.00001591550084597084560981867696642792530262164835895146399711879970659023874730602864887138053648291003    ```

I'm working on an exact answer to the oblate spheroid case
31 May 2013, 15:57
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 17284
revolution
tthsqe: I computed the circumference of the latitude line that is 10km (following the great circle line) from the pole (=~62,831.xxx m) and then divided the 1m deviation by the circumference. Note that the latitude line is not exactly 10km in a straight 3D line from the pole, but slightly less because the man walks in a curved path along the surface.
31 May 2013, 17:34
tthsqe

Joined: 20 May 2009
Posts: 729
tthsqe
Quote:
I computed the circumference of the latitude line that is 10km (following the great circle line) from the pole (=~62,831.xxx m)

I agree - this circumference is 2*Pi*r*Sin[10^4/r] = 62831.8.... .

Quote:
and then divided the 1m deviation by the circumference

This is not correct because the distance measured along a path of constant latitude is not the real distance between two points because the real distance between two points is measured along great circles (geodesics).

The only time a path of constant latitude is a geodesic is at the equator, where we clearly are not.
31 May 2013, 18:14
bitRAKE

Joined: 21 Jul 2003
Posts: 2915
Location: [RSP+8*5]
bitRAKE
tthsqe, since you are using Mathematica, try EllipticE.
(I just coded it in x86 to be different.)

_________________
31 May 2013, 18:16
tthsqe

Joined: 20 May 2009
Posts: 729
tthsqe
Yeah, I'm trying to be very precise and compute distances along geodesics only. It looks like EllipticE and JacobiCN are going to come into play.

The first problem is to find the latitude that is 10km away from the south pole.
This is directly solvable by EllipticE.

The second problem is: given a point P1 on this latitude, what is difference in latitude measurements from P1 to P2 where P2 is a point on the same latitude that is 1/2 meter away.

If dif is this difference then dif/Pi is the answer. It seems that you and revolution are brushing this second more difficult problem under the rug by measuring the distance between P1 and P2 on the path of constant latitude, which is NOT correct.
31 May 2013, 18:34
bitRAKE

Joined: 21 Jul 2003
Posts: 2915
Location: [RSP+8*5]
bitRAKE
tthsqe wrote:
It seems that you and revolution are brushing this second more difficult problem under the rug by measuring the distance between P1 and P2 on the path of constant latitude, which is NOT correct.
Well, I just wanted to ask specifically before proceeding because the story is evolving. The numerical integration method is kind of brute force - it'll work on just about anything you can write an equation for, or as long as your laser range-finder is sending data.

_________________
31 May 2013, 18:57
tthsqe

Joined: 20 May 2009
Posts: 729
tthsqe
Ok - i took some time to work out the geodesics on a oblate spheroid.
Suppose it is parameterized as (a>c)
Code:
```x = a Sin[phi] Cos[th]
y = a Sin[phi] Sin[th]
z = c Cos[phi]    ```

Suppose we have a geodesic on the spheroid whose minimum phi value is A. Then, up to a translation of th, the equation of the geodesic is
Code:
```th = (a^2 - c^2)/(a c) Sin[A] EllipticF[ArcSin[Cos[phi] Sec[A]], (1 - a^2/c^2) Cos[A]^2]
- a/c Sin[A] EllipticPi[Cos[A]^2, ArcSin[Cos[phi] Sec[A]], (1 - a^2/c^2) Cos[A]^2]    ```

and the geodesic distance from the top point of the geodesic curve to the point with phi coordinate phi is
Code:
`dist = c EllipticE[(1 - a^2/c^2) Cos[A]^2] - c EllipticE[ArcSin[Cos[phi] Sec[A]], (1 - a^2/c^2) Cos[A]^2]    `

So for the problem with the man returning to within 1 meter of where he started,
we star with the nominal earth parameters
Code:
```a = 6378137;
c = 6356752;    ```

In the second equation, we set A=0 and dist = 10^4 and solve for phi to get
Code:
`phi1=0.001567855947187549350573731852825121127458698007839610924159566726042931197415280813723313352047736412    `

This is the phi coordinate for the latitude line.

If at this point you want to be lazy and not measure lateral distances correctly you would say the probability is
Code:
`1/(2 Pi a Sin[phi1]) = 0.00001591550078604449742390797335378995799809927679132959904833665428472097211803647706324535886835928774    `

To measure a distance of 1/2 along the latitude correctly, we need to set phi = phi1 and dist = 1/4 in second equation and solve for A. This gives
Code:
`A1=0.00156785594669759476309053550945843164246506606122572921921063846078865137988334320565674775526647844131965    `

Finally to obtain change in theta coordinate we set A=A1 and phi=phi1 in the first equation and evaluate, then set A=A1 and phi=A1 in the first equation and evaluate. Subtract those last two number and divide by Pi/2 to get the probability
Code:
`0.00001591550078770235939089795032308014923648609536773659627638542320520723543527438834398539168868112722010    `

This is the correct probability if all of the distances are measured exactly correctly. It is a little bit bigger because measuring along the shortest path allows you a greater range.
31 May 2013, 21:29
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 17284
revolution
I wonder if we are discussing the same thing?

Attached is diagram looking directly down towards the start point (not to scale). The pole would be on the right where the grey lines meet.

Any return path outside the grey lines will return to a point more than 0.5 metre from the start point. Any path inside the grey lines is the portion of the 10km latitude we are interested in. The man can only return to the parts coloured either green or orange.

 Description: Probability = green section divided by the orange section Filesize: 6.49 KB Viewed: 7646 Time(s)

01 Jun 2013, 04:21
tthsqe

Joined: 20 May 2009
Posts: 729
tthsqe
Ok, so you are moving along the green latitude line for 0.5 meters in either direction. My point is that after you do this you end up at a point that is less than 0.5 meters away because there is a shorter path than the latitude line.

In order to end up at a point that is actually 0.5 meters away from the starting point, you need to travel a little bit more than 0.5 meters due east/west.

In my picture, in order that the length of the black geodesic between the two green points be exactly 0.5 meters, the length of the blue path (which is necessary for the probability calculation) must be greater than 0.5 meters.

To sum it up if the length of the green path is 1 when measured along the latitude, then
the probability is not (length of green path)/(length of orange path) because the end points of the green path are not 0.5 meters away from the starting point
So you are slightly underestimating the true probability.
It is also related to the fact that planes don't fly on latitude lines eventhough the origin/destination might both lie on the same latitude.
The first equation in my previous post gives the exact geodesic (path of shortest length), and the second gives the length of the geodesic (length of shortest path).
01 Jun 2013, 05:25
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 17284
revolution
tthsqe wrote:
the probability is not (length of green path)/(length of orange path) because the end points of the green path are not 0.5 meters away from the starting point
But the ends of the green path are bounded by the black circle. The black circle is defined as being 0.5 metres from the start point, so the ends of the green path must be 0.5 metres from the start point by definition. The length of the green path is not precisely 1 metre because it is curved and because it is truncated by the circle at points not precisely on the diameter, but the end points are still 0.5 metres from the start.
01 Jun 2013, 06:14
tthsqe

Joined: 20 May 2009
Posts: 729
tthsqe
sorry, you misquoted me. the whole quote was
if the length of the green path is 1 when measured along the latitude, then
the probability is not (length of green path)/(length of orange path) because the end points of the green path are not 0.5 meters away from the starting point

I agree with everything you just said, and you just granted me the entire argument by saying
Quote:
The length of the green path is not precisely 1 metre because ...

This is my point to begin with. In your most recent solution, when you did
Quote:
and then divided the 1m deviation by the circumference

you assumed that the length of the green path is 1 meter.

The green path is a latitude line and has a length greater than 1 meter.
The black circle consists of all points that are 0.5 meters from the start.
The probability then is indeed (length of green path)/(length of orange path)
01 Jun 2013, 06:43
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 17284
revolution
"1m deviation" was not intended to say I used the value of 1m. In fact I didn't want to give away information by stating I used a value that was not quite 1m, and by using the term "1m deviation" I was trying to make the reader consider the deviation from the centre, not the length if the target line that falls within the circle.

But no matter, a bit is misunderstanding is always a risk when trying to not give away answers too readily. I think we have fully explored the variables here. And thanks for your diagram, it is much better quality than mine.

Is anyone interested in the next part of the puzzle? It raises a new point into the discussion that has not been mentioned in the first two parts.
01 Jun 2013, 08:12
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 17284
revolution
Can someone please give me an example of an indescribable number?
10 Aug 2015, 08:18
YONG

Joined: 16 Mar 2005
Posts: 8000
Location: 22° 15' N | 114° 10' E
YONG
revolution wrote:
Can someone please give me an example of an indescribable number?

Assume that you are NOT talking about numerical approximations.

Then here is an example.

There is no explicit formula for general quintic (or higher degree) equations over the rationals in terms of radicals. Thus, there are no general ways to "describe" the roots of such equations.

Is that what you are looking for?

10 Aug 2015, 13:16
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 17284
revolution
Hmm, I thought it was a standard mathematics definition but it appears to be called an indescribable cardinal instead.

http://scienceblogs.com/goodmath/2009/05/15/you-cant-write-that-number-in/
10 Aug 2015, 13:38
YONG

Joined: 16 Mar 2005
Posts: 8000
Location: 22° 15' N | 114° 10' E
YONG
revolution wrote:
it appears to be called an indescribable cardinal instead.
Looks kind of boring to me. I would rather spend my time on the following:

P versus NP problem
https://en.wikipedia.org/wiki/P_vs_np

11 Aug 2015, 02:16
tthsqe

Joined: 20 May 2009
Posts: 729
tthsqe
yong - the roots of the general quintic can be described by formulas. See section 8.2 in http://math.uiuc.edu/~schult25/ModFormNotes.pdf. There is one obvious and trivial typo in the statement of Proposition 8.3.1, but other than that, it looks correct.
11 Aug 2015, 03:24
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

 Jump to: Select a forum Official----------------AssemblyPeripheria General----------------MainDOSWindowsLinuxUnixMenuetOS Specific----------------MacroinstructionsCompiler InternalsIDE DevelopmentOS ConstructionNon-x86 architecturesHigh Level LanguagesProgramming Language DesignProjects and IdeasExamples and Tutorials Other----------------FeedbackHeapTest Area
Goto page Previous  1, 2, 3 ... 23, 24, 25, 26  Next

Forum Rules:
 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou can attach files in this forumYou can download files in this forum