• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
paulkinlan

paulkinlan

how-far-from-north-pole

Public
Like
how-far-from-north-pole
Home
Code
2
README.md
H
index.ts
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
README.md

Distance to North Pole Web App

A simple web application that calculates the distance from the user's current location to the North Pole.

Features

  • 📍 Geolocation: Uses the browser's geolocation API to get the user's current position
  • 🧭 Distance Calculation: Calculates the great circle distance to the North Pole using the Haversine formula
  • 📏 Unit Conversion: Allows users to toggle between kilometers and miles
  • 🎨 Responsive Design: Clean, mobile-friendly interface using TailwindCSS
  • ⚡ Real-time Updates: Distance updates instantly when switching between units

How It Works

  1. Click "Get My Location" to request location access
  2. The app uses the browser's geolocation API to get your coordinates
  3. It calculates the distance to the North Pole (90°N, 0°E) using the Haversine formula
  4. Toggle between kilometers and miles to see the distance in your preferred unit

Technical Details

  • Distance Calculation: Uses the Haversine formula for calculating great circle distances on Earth
  • Earth Radius: 6,371 km (mean radius)
  • Conversion Factor: 1 km = 0.621371 miles
  • Geolocation Options: High accuracy enabled with 10-second timeout

Privacy

  • Location data is only used for distance calculation
  • No location data is stored or transmitted to any server
  • All calculations happen in your browser

Browser Compatibility

Requires a modern browser with:

  • Geolocation API support
  • JavaScript enabled
  • HTTPS connection (required for geolocation)

Usage

Simply visit the web app and click "Get My Location" to start!

Code
README.md
H
index.ts
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.