geometryspherical

Lat Long

Available under GPL (Free) and Commercial licence
get a GPL licence
COST (GBP)
this unit 0.00
sub units 0.00
add a commercial licence to your cart
0
viewed 2481 times and licensed 23 times
www.codecogs.com/d-ox/geometry/spherical/latlong.php
Controller: CodeCogs    Contact Controller

Interface

#include <codecogs/geometry/spherical/latlong.h>

double latitude (int degrees, int minutes=0, float seconds=0, char compassDirection='N')
Converts latitude expressed in degrees, minutes and seconds into Degrees.
double longitude (int degrees, int minutes=0, float seconds=0, char compassDirection='N')
Converts latitude expressed in degrees, minutes and seconds into Degrees.

Function Documentation

Latitude Calculator

  

Add calculator to your site or email
 
doublelatitudeintdegrees
intminutes = 0
floatseconds = 0
charcompassDirection = 'N' )
Returns an geographical location in degrees, minutes and seconds as a single numeric angle from the center of the earth, expressed in Degrees. There are a total of 180 degrees from the South pole to the North pole. By convention there are 60 minutes in one degree, and naturally 60 seconds in each minute.
Example:
#include <codecogs/geometry/spherical/latlong.h>
#include <iostream>
int main()
{
	std::cout << "New York is at a Latitude  of: " << latitude(40,47,0,'N') << " degrees" << std::endl;
	std::cout << "London is at a Latitude of: " << latitude(51,32,0,'N') << " degrees" << std::endl;
		return 0;
}
Output:
New York is at a Latitude  of: 40.7833 degrees
London is at a Latitude of: 51.5333 degrees
Parameters:
degreesDegrees from -90 to 90
minutesMinutes from 0 to 60.
secondsSeconds from 0 to 60.
compassDirectionThe key direction either 'N' for North, or 'S' for South.
Source Code:
Register

- To get code register with CodeCogs. Already a Member, then Login.


Longitude Calculator

  

Add calculator to your site or email
 
doublelongitudeintdegrees
intminutes = 0
floatseconds = 0
charcompassDirection = 'N' )
Returns an geographical location in degrees, minutes and seconds as a single numeric angle from the center of the earth, expressed in Degrees. There are a total of 360 degrees around the world. By convention there are 60 minutes in one degree, and naturally 60 seconds in each minute.
Example:
#include <codecogs/geometry/spherical/latlong.h>
#include <iostream>
int main()
{
	std::cout << "New York is at a Longitude of: " << longitude(73,58,0,'W') << " degrees" << std::endl;
	std::cout << "London is at a Longitude of: " << longitude(0,5,0,'W') << " degrees" << std::endl;
  return 0;
}
Output:
New York is at a Longitude of: -73.9667 degrees
London is at a Longitude of: -0.0833333 degrees
Parameters:
degreesDegrees from -180 to 180. if you need to go futher than 180 degrees east or west, then you should describe that location from the opposite direction.
minutesMinutes from 0 to 60.
secondsSeconds from 0 to 60.
compassDirectionThe key direction either 'N' for North, or 'S' for South.
Source Code:
Register

- To get code register with CodeCogs. Already a Member, then Login.


Last Modified: 18 Oct 07 @ 17:07     Page Rendered: 2008-05-09 23:05:58

Page Comments

  You must login to leave a messge


Valid CSS!   Valid XHTML 1.0 Transitional