As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
Haversine formula:
R = earth’s radius (mean radius = 6,371km)
Δlat = lat2− lat1
Δlong = long2− long1
a = sin²(Δlat/2) + cos(lat1).cos(lat2).sin²(Δlong/2)
c = 2.atan2(√a, √(1−a))
d = R.c
(Note that angles need to be in radians to pass to trig functions).
JavaScript: var R = 6371;
var dLat = (lat2-lat1).toRad();
var dLon = (lon2-lon1).toRad();
var a = Math.sin(dLat/2) * Math.sin(dLat/2) +
Math.cos(lat1.toRad()) * Math.cos(lat2.toRad()) *
Math.sin(dLon/2) * Math.sin(dLon/2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
var d = R * c;
Adong, i think we would all agree that it depends on how much accuracy you need. Do you need to correct for the curvature of the earth, or not? If not, then plain old Pythagoras should be good enough, after xlating your latlongs into radians. If your distances are all within your country (you don't say what country you're in), you can decide just how much agony you need to go thru. If your distances are crossing continents, then Tony and Glenda have done your heavy lifting for you. (looks like a great first entry for the new wf wikipedia!)
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
I think that this topic is one worthy for writing an article about for the FOCUS on Developers area. I'm sure Kathleen would agree as it is bound to come up time and again. What do you reckon?
T (currently in Vegas!!)
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
I'm just a puzzle solver. The more challenging the better. When a COBOL programmer said WeBFOCUS code was too limited to perform distance calculations, it was like waving a red flag in front of a bull (or a stubborn Irish gal).
I don't know the first thing about writing an article. If you want to help me or write it yourself, I won't mind. It sure would save others from what I had to go through to find the information.
And don't rub it in! I couldn't make Las Vegas this year and I so wanted to meet you and the others. Glenda
I discussed this issue (more in general) with some people from IBI in Vegas. It is indeed not easy to use recursive programming within webfocus and create formulas for several mathematic or financial functions like IRR and FV etc. But I'm sure that they will see it as a challange to forfill our wishes on this point if we ask them
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006
I agree totally, just tell me that "it can't be done" and I will try to find a way. Just as when Susannah said that trig functions are not possible in Feb in answer to the original question.
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
T and Glenda... i see a really great Summit presentation on this subject for the 2 of you to do together for 2008... and there's a chance, i hear, that Summit might be in Dallas... close enough for "Red" to get there.
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
YOu are so perceptive. I never said a thing about being a redhead. But yes, that's where the stubborn streak comes from. I like your idea. I'm game if Tony is.