|
Ha has a neutrino gun!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
CPallini wrote: Ha has a neutrino gun!
dagnabbit! I want one!!!!
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
chandu004 wrote: is it possible to find the distance in meters between the two points if i have, their longitude, latitude and height.
The short answer: Yes.
The long answer: you need to deal with great-circle (geodesic solution) calculations. See: http://mathworld.wolfram.com/GreatCircle.html[^]
There is also an iterative solution that is often used for boat/air travel. Obviously continuously changing your heading to provide the absolute shortest route to the meter is difficult. So you create waypoints travel to them, change heading and travel to the next, etc., until you reach your destination. This has become easier with computers because a computer auto-pilot will auto-navigate to many more waypoints with micro changes in heading to keep a shorter path. But with ocean travel that is somewhat more difficult.
The question becomes how accurate do you need it, and what is the purpose of the answer. The piece-wise iterative approach would be:
<br />
surfacedistance(from: lat, lon, alt; to: lat, long, alt)<br />
{<br />
distance= ECEFdistance(ecef(to),ecef(from));<br />
if (distance<1000) return distance;<br />
ecef_mid=ecef_to*0.5+ecef_from*0.5;<br />
spher_mid=togeodetic(ecef_mid);<br />
spher_mid.alt=from.alt*0.5+to.alt*0.5;<br />
return surfacedistance(from,spher_mid)+surfacedistance(spher_mid,to);<br />
}<br />
or something similar (that is off the top of my head, google piecewise approximation of geodesic distances. The idea is that you can sum a series of vector distances in local space and the more accurate your division, the more accurate the answer. You can choose speed over accuracy at any point by changing the approximation distance change between mid-point division and vector-distance.
The bad news is, if you set the value too low, it is a heavy recursion level and you are better off calculating it directly. There are times in implimentation you may want to do either for other reasons related to use of the answer.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
chandu004 wrote: is it possible to find the distance in meters between the two points if i have, their longitude, latitude and height.
Like these:
http://mathforum.org/library/drmath/view/51720.html
http://jan.ucc.nau.edu/~cvm/latlongdist.html
http://mathforum.org/library/drmath/view/51711.html
http://www.movable-type.co.uk/scripts/latlong-vincenty.html
http://mathforum.org/library/drmath/view/54680.html
http://www.freevbcode.com/ShowCode.asp?ID=5532
http://mathforum.org/library/drmath/view/51717.html
http://www.meridianworlddata.com/Distance-Calculation.asp
http://mathforum.org/library/drmath/view/51722.html
http://www.csgnetwork.com/longlatdistance.html
http://mathforum.org/library/drmath/view/54941.html
http://www.csgnetwork.com/lldistcalc.html
http://mathforum.org/library/drmath/view/54680.html
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
thanks a lot david,
one of the above links helped me to understand many interesting points.
and the logic worked for some of hte examples, so far i have tested.
|
|
|
|
|
chandu004 wrote: and the logic worked for some of hte examples, so far i have tested.
the logic should work quite well. I haven't gone through most of the links, but I checked a few of them. I am not sure what you need the answer for, but it would be wise to clarify that your answer is for a spherical Earth not an ellipsoidal model. At least the ones I followed so far assume a spherical earth. This is a decent approximation, but again, it depends on what you are trying to do. No answer will be exactly right because even an ellipsoidal model is an approximate surface. The true surface is mapped in elevation points to the geoid.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
You probably know that the "standard distance" for 1 nautical mile is 6076.115 feet. And that 1 degree of latitude is 60 Nautical miles (NM). There is no "standard" for longitude since it is wider at the equator and they all conjoin at the poles to zero distance. I think there is a formula for determining the length of 1 degree of longitude based on the latitude where the longitude is taken, but don't know it offhand. If you are somewhere in the range of 30 to 60 degrees latitude, the "standard distance" formula will get you close to the correct distance between two points.
John P.
|
|
|
|
|
the easiest way to do it (assuming spherical earth)is to convert the lat-lon values into X-Y-Z values.
The center of the earth is (0,0,0),
the intersection of the prime meridian and the equator is (R,0,0)
lat 0, lon +90 is (0,R,0),
the north pole is (0,0,R)
the south pole is (0,0,-R)
where R = radius of earth
to go from lat lon to x y z is:
x = R * Cos(lon) * Cos(lat)
y = R * Sin(Lon) * Cos(lat)
z = R * Sin(lat)
You do that for point 1 and point 2, then determine the distance between them (straight line)
x' = x2-x1
y' = y2-y1
z' = z2-z1
d = sqrt((x'*x')+(y'*y')+(z'*z'))
One half of the angle from point 1 to point 2 is
a = ArcSin(d/2R)
to get the great circle distance take this angle (in radians), double it to get the actual angle, them multiply if by the radius of the earth
D = 2 * a * R
where D is the distance you are looking for.
|
|
|
|
|
Hi guys,
Anybody knows some method to convert free hand curve to bezier curves ?
Please reply..
Thanks,
kd
If u can Dream... U can do it
|
|
|
|
|
What about Least Squares Fit?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Thanks for a hint CPallini , I will look it.
If u can Dream... U can do it
|
|
|
|
|
Hello everybody,
I'm a newcomer.
I intend to share my knowledge about chinese chess (or xiangqi), programmed for computers to play, especially in artificial intelligence domain. I've made a quite good program.
I wonder whether it is welcomed ot not.
I'm looking forward to hearing from you.
|
|
|
|
|
Welcome to CodeProject.
There are articles here at CodeProject covering a variety of subjects aimed at various levels of expertise. If you wish to share your expertise then an article is the way to go.
There are published guidelines here http://www.codeproject.com/info/submit.asp[^]
modified 1-Aug-19 21:02pm.
|
|
|
|
|
yuneiv wrote: I wonder whether it is welcomed ot not.
Write an article about your program and offer it in the form of source code for people to look at. Take it from there
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Thank you, I think all I have to do now is spending time to prepare my very first acticle.
But could you show me a way to put a mass of over 4300 lines of code into an acticle and explaining hundreds of exciting points. It may take over a hundred pages. Suggest me a way to prune it off. Can I break it into several parts and show them one by one.
Help me. Thanks.
|
|
|
|
|
yuneiv wrote: show me a way to put a mass of over 4300 lines of code into an acticle
You don't. You have your source and project in a zip file for people to download on the CP server.
yuneiv wrote: explaining hundreds of exciting points
Look around at the general interest that people have around here, and just pick the top 3 to 5 pieces that might be really useful.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
|
yuneiv wrote: But could you show me a way to put a mass of over 4300 lines of code into an acticle...
Assuming you are wanting the article's body to contain that much code, don't even go there. Supporting code should be in an attached (zip) file. You can certainly have code in the article's body, but it should be limited, and only to highlight important points, not just to take up room. You may lose a lot of potential readers when they are presented with pages full of code.
yuneiv wrote: Can I break it into several parts and show them one by one.
Yes, several CP members have done just that for large subjects.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
what is the method to print the nodes of a B-tree of any degree?
in preorder or postorder...
sushma
|
|
|
|
|
Sounds like homework, so no help here.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I don't quite get your question so I can't help.
Paul Conrad wrote: Sounds like homework, so no help here.
What's wrong with helping people with homework as long as it is not the "can you do my project for me type of questions"? As long as their question is specific and is asking how to do something and not for the code itself why not?
|
|
|
|
|
MikeMarq wrote: as long as it is not the "can you do my project for me type of questions"?
Nothing is wrong with it, provided that it isn't asking for someone to do the work.
In this case, I think the problem is that the theory behind how to do a post-order and in-order traversal of a tree should have been covered in class before giving the assignment.
|
|
|
|
|
This definately sounds like a homework problem and the theory behind how to do a pre-order and post-order traversal should have been covered in class. You can try looking here http://en.wikipedia.org/wiki/Post-order_traversal[^] for more conceptual information, but no one here is going to just give you the code.
|
|
|
|
|
well well...this was not posted with t intention of getting my homework done.....
ok i got tht 4m t site ...thanx!
|
|
|
|
|
Hi dear reader. I did symmetric key data encryption and decryption algorithms, which are focused on small one byte for encrypting and output sixteen bytes for decryption, ready but problem is that i could not checked it my strength of the algorithm yet because of the not sure the criteria of the measurements for cryptography and algorithm as well. I hope a professional person,who are good the cryptography or got expensive experience of at this area, can help me to resolve my problem and can advice what i to do that is better. Help me please?
Thank you
Regards Bimbaa
-- modified at 9:56 Tuesday 30th October, 2007
|
|
|
|