# NewGamePhysics.Mathematics.EquirectangularProjection Class Reference

Calculate the equirectangular projection (also called the equidistant cylindrical projection, geographic projection, plate carrée or carte parallelogrammatique projection or CPP between lat,lon (degrees) to/from x,y ([0,1]). Reference: http://en.wikipedia.org/wiki/Plate_carr%C3%A9e_projection. More...

List of all members.

## Static Public Member Functions
static double | lonToX (double lon)
| Convert longitude [0,360] to [0,1] using the mercator projection.
static double | latToY (double lat)
| Convert latitude [-90.0,90] to a map position [0,1] using the equirectangilar projection.
static double | xToLon (double x)
| Convert a map position [0,1] to longitude [0,360] using the equirectangular projection.
static double | yToLat (double y)
| Convert [0,1] to latitude [-90,90] using the equirectangular projection.

## Detailed Description

Calculate the equirectangular projection (also called the equidistant cylindrical projection, geographic projection, plate carrée or carte parallelogrammatique projection or CPP between lat,lon (degrees) to/from x,y ([0,1]). Reference: http://en.wikipedia.org/wiki/Plate_carr%C3%A9e_projection.

Definition at line 20 of file EquirectangularProjection.cs.

## Member Function Documentation

static double NewGamePhysics.Mathematics.EquirectangularProjection.latToY | ( | double | lat | ) | `[static]`

Convert latitude [-90.0,90] to a map position [0,1] using the equirectangilar projection.

Parameters:

  | lat | The latitude in degrees.

Returns:
  The map position.

Definition at line 44 of file EquirectangularProjection.cs.

    00045         {
    00046             if ((lat < -90.0) || (lat > 90.0))
    00047             {
    00048                 throw new ArgumentOutOfRangeException("lat");
    00049             }
    00050
    00051             return (lat / 90.0 + 1.0) / 2.0;
    00052         }

static double NewGamePhysics.Mathematics.EquirectangularProjection.lonToX | ( | double | lon | ) | `[static]`

Convert longitude [0,360] to [0,1] using the mercator projection.

Parameters:

  | lon | The longitude in degrees.

Returns:
  The map position.

Definition at line 28 of file EquirectangularProjection.cs.

    00029         {
    00030             if ((lon < 0) || (lon > 360.0))
    00031             {
    00032                 throw new ArgumentOutOfRangeException("lon");
    00033             }
    00034
    00035             return lon / 360.0;
    00036         }

static double NewGamePhysics.Mathematics.EquirectangularProjection.xToLon | ( | double | x | ) | `[static]`

Convert a map position [0,1] to longitude [0,360] using the equirectangular projection.

Parameters:

  | x | The horizontal map position.

Returns:
  The longitude value.

Definition at line 60 of file EquirectangularProjection.cs.

    00061         {
    00062             if ((x < 0.0) || (x > 1.0))
    00063             {
    00064                 throw new ArgumentOutOfRangeException("lon");
    00065             }
    00066
    00067             return x * 360.0;
    00068         }

static double NewGamePhysics.Mathematics.EquirectangularProjection.yToLat | ( | double | y | ) | `[static]`

Convert [0,1] to latitude [-90,90] using the equirectangular projection.

Parameters:

  | y | The vertical map position.

Returns:
  The latitude in degrees.

Definition at line 76 of file EquirectangularProjection.cs.

    00077         {
    00078             if ((y < 0.0) || (y > 1.0))
    00079             {
    00080                 throw new ArgumentOutOfRangeException("lon");
    00081             }
    00082
    00083             return y * 180.0 - 90.0;
    00084         }

The documentation for this class was generated from the following file:

- C:/Users/Andreas Schiffler/Desktop/SVN/NewGamePhysics/NewGamePhysics/Mathematics/EquirectangularProjection.cs