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.
We need to compare a given zip code to several zip codes in a file to determine which of these zips are within 40 miles of this zip code.
Since WebFOCUS was not created to support scientific or analytical applications, how do we create our own higher math functions (trig functions) to employ the distance calculator.
We have never utilized User-Written Subroutine route for the trig functions and would love any guidance anyone has to offer on how to set one up and employ it.
i'm with you, Glenda. we've asked and asked and asked for the basic trig functions. I've even asked Gerry. ignored. thankfully, i don't need that degree of accuracy, ...so i just use Pythagoras, figuring that accounting for the curvature of the earth is overkill, given that I only have latlong (which i xlate into radians) for zip centroids anyway.. the old gray 'user written subroutines' manual has morphed into the 'functions' manual (#4 in the standard set) and there's nothing in there to help. Remember ANALYZE FILE from mainframe days?..if they would just give us sin cos tan and a few arcs, bliss. the official answer would probably have something to do with the SPSS partnership.This message has been edited. Last edited by: susannah,
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
I wanted to clarify my last post. I was trying to suggest that you use the DEFINE FUNCTION syntax to create your own trig functions. If you know the equations that you need then you can build a function with DEFINE FUNCTION.
Sorry for the confusion of my last post. I normally do not respond to FocalPoint that late at night
Thanks!
Mickey
FOCUS/WebFOCUS 1990 - 2011
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003
mick..would that it were that simple...alas, define function still limits us to the basic arithmentic available with focus operators.. the option of loading up trig tables if you need that degree of accuracy...probably available somewhere... hey look, i found 'em oh rats now i have to go rewrite my store locatorThis message has been edited. Last edited by: susannah,
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
You can use the defines below to find sin or cosin for any value between 0 and pi/4 radians. The results (SIN or COSIN) are very nearly accurate to a double, and should be perfectly adequate for any commercial application. You can use trig identities to get any other angle you need. The input XVAL is a double.
super, thanks T, and welcome to the Point, Edward. the F_SIN works great, T, thanks. I still find i need the arccosin , in algebra,..to finish the distance equation( or the arctan if we use the haversine eq ) so i'm still stuck with pythagoras .. which means i'm telling my production people that the shortest distance between the warehouse and the factory in china is thru the middle of the earth..but hey..
here is a source for lat long for zipcodes (us) free! NB: zipcodes change. every month a little, but every November the major changes for the year. so their zipcentroids shift..so when you get a list from ..wherever...keep it updated, and when you find two lists with different numbers, that's the reason.This message has been edited. Last edited by: susannah,
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
Put the DEFINE FUNCTION in the EDASPROF.PRF file. That's where I have all of mine.
Another way to do it would be to set the _site_profile in the WF Client SITE.WFS file to -INCLUDE a focexec containing the DEFINE FUNCTION code. The only gotcha with this method is that they will not be available for Report Caster.
Thanks!
Mickey
FOCUS/WebFOCUS 1990 - 2011
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003
My production people might accept the route through the middle of the earth, but the state board of insurance wouldn't like it one bit. So, I must find the arctan2 equation, in algegra, in order to use the haversine equation. The arccosin , in algebra, would be my second choice to finish the distance equation. After search all over the internet, the only thing I've come up with is a headache. I've been out of school too many years to remember much about logs and the few formulas I've seen are greek to me. Maybe I'm just getting too old for this and need to move over and let you younger ones move in.
But since I'm stubborn, I'll keep on reading until I understand it or one of you can explain it. Anyone have any ideas?
Using Edwards technique (thanks Edward), a simple FUNCTION can be created that should give you the distance you require. As Edward intimates, over short distances this should not be too inaccurate. If you are looking for distances over the entire globe then you will need an ARCTAN2 function (not got that working yet ).
To call it just COMPUTE (or otherwise) the value using - Distance/D20.4 = F_DIST(86.51557,33.584132,86.959727,33.588437);
Using this FUNCTION I got a distance of 49.39 km between Acmar, Alabama and Adamsville, Alabama (basically the first two off of the link from Susannah) and using this link to double check using the haversine method, I got the same value.
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