I had the greatest middle school math teacher. His name was Mr. Panning. He was a great teacher. He was a great cross country coach. And especially at that point in my life - he was a great role model.I remember sitting in Geometry my 8th grade year and numerous times hearing students (*cough* myself) saying, "when the heck am I going to need to know this in the real world."
More on that later...
We decided at last week's creative strategy meeting that one thing we wanted to do with the website was to "localize" it to the market we are in. So, for example, if someone from Tucson visits the website, the design reflects the fact we are on KQTH in Tucson. Or if in Fort Wayne, it reflects WOWO. You get the idea.
Pretty unique, huh? Problem is: this is not an easy thing to do.
First, one has to find all 41,700 zip codes and assign a latitude/longitude to each one of them into a database scheme.
Second, one has to then figure out what zipcodes are associated with which radio station (for example WSB in Atlanta has 646 zip codes it reaches). This is not particularly easy due to the fact that every station has a different "reach" even within their own city.
Third, and this is the toughest part, one has to be able to know where you, the web visitor is coming from. The idea is that from your IP address we extract your zipcode (not always reliable). From the zipcode, we extract a lat/lon coordinate.
Fourth, once one has the users lat/lon coordinate then one has to reverse search to find the nearest associated radio market (if there is one).
Second, one has to then figure out what zipcodes are associated with which radio station (for example WSB in Atlanta has 646 zip codes it reaches). This is not particularly easy due to the fact that every station has a different "reach" even within their own city.
Third, and this is the toughest part, one has to be able to know where you, the web visitor is coming from. The idea is that from your IP address we extract your zipcode (not always reliable). From the zipcode, we extract a lat/lon coordinate.
Fourth, once one has the users lat/lon coordinate then one has to reverse search to find the nearest associated radio market (if there is one).
Crazy I know. But what does this have to do with math?
Taking someone's lat/lon coordinates and figuring out what zipcode that coordinates to (and therefore what radio market) incorporates some crazy math. Mainly using the Great Circle Formula to determine proximity:
Earth Radius (3963.0) * ACOS( SIN( Latitude of User * π/180 ) *
SIN( Latitude of Market Zip Code * π/180 ) +
COS( Latitude of User * π/180 ) *
COS( Latitude of Market Zip Codes * π/180 ) *
COS( (Longitude of Market Zip Code * π/180) -
(Longitude of User * π/180) ) )
SIN( Latitude of Market Zip Code * π/180 ) +
COS( Latitude of User * π/180 ) *
COS( Latitude of Market Zip Codes * π/180 ) *
COS( (Longitude of Market Zip Code * π/180) -
(Longitude of User * π/180) ) )
Take that formula, incorporate with a MySQL database schema, sort by distance from nearest to furthest, limit your results to 1 (the nearest) and bam! You've figured out figured out the radio market a web visitor is in.
I guess my punk-8th grade self has his answer 12 years later.
There was a lot I learned back then I never knew how I would use.
I think about the only web programming class I have ever taken was in 7th grade. And the only video editing class I ever took was in 8th grade. The only design class I took was Sophomore year of high school. All while I thought I was going to be a doctor or an attorney.
On top of that, my last math class was pre-calculus my Junior year of high school.
10 years later, and with out a single college class in any of those fields, I find those classes were a great foundation.
What do you think you are learning today that you will utilize 10 years down the road?
I know as I get older I have become less teachable. We become "experts." We think we know what we need to know and ignore the rest. But like 8th graders in math class, just because we can't foresee what we need down the road, it never hurts to learn new things.
As my Uncle once told me, "you are either learning or you are dying." It's your choice.






Cool work man - I tried it out and it didn't get my exact zip, but had the proximity right.
I have a few questions though. You calculate the distance between user zip code and radio station zip code. But in your second point you seem to indicate that your database would not have station coverage distances but a list of covered zip codes, which would better account for non-circular coverage areas, like the one of WOWO (see both daytime and nighttime coverage maps) anyway. Then the great circle formula would be superfluous - you would merely have to compare the user zip code with zip codes associated with a radio station.
I agree with your uncle though. A man learns as long as he lives, and that is even more important today with exponentially increasing knowledge base.
Mainly design elements (i.e. different background, different headers, etc...). The content will be relatively the same. When we first "pitch" the show, keep in mind we have to pitch it to stations. Stations have their own interests and objectives that sometimes syndicated shows don't share. So the advantage is two fold. 1.) It shows them we are on top of technology like no one else in the business (which is true, especially with some of the new features coming), and 2.) that we are partners in our endeavor and want them to succeed at their goals just as much as we want to succeed at ours.
It's not a perfect process I freely admit. But it gets the basic idea. You are right using the GCD was taking the "easy" way out to some degree, but I don't have an IT staff, and I am only one guy doing a crap-ton of other jobs so every once and a while I cut a few corners when the added time doesn't bring a significant added benefit.
He's a smart dude. One of Atlanta's premier technology venture capitalist. Great business man. I have learned a lot from the man.
Well at least you don't need to know this stuff in your line of work to get a raise ;)
Well it doesnt take into account the flatening of the earth towards the poles so remember to convert all of that to State Plane Coordinate System. I went to college to be a pastor and spent for years as an engineer... hey life happens :)