~ubuntu-branches/ubuntu/intrepid/grass/intrepid

« back to all changes in this revision

Viewing changes to vector/v.to.db/units.c

  • Committer: Bazaar Package Importer
  • Author(s): Noèl Köthe
  • Date: 2008-04-06 17:08:21 UTC
  • mfrom: (1.1.5 upstream) (3.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080406170821-7l3d3ulh4g8crwcs
Tags: 6.2.3-2.1
* NMU during credativ BSP 2008
* using patch from Moritz Muehlenhoff <jmm@inutil.org> to fix
  FTBFS with GCC 4.3: missing #includes
  (closes: #461673)

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
    int     i;
8
8
    double  f=1.0, sq_f=1.0;
9
9
 
10
 
    switch ( options.units)
 
10
    switch (options.units)
11
11
    {
12
12
        case U_METERS:
13
13
            f      = 1.0;
20
20
            break;
21
21
 
22
22
        case U_ACRES:
23
 
            sq_f   = 2.471e-4;
 
23
            sq_f   = 2.47105381467165e-4; /* 640 acres in a sq mile */
24
24
            break;
25
25
 
26
26
        case U_HECTARES:
28
28
            break;
29
29
 
30
30
        case U_MILES:
31
 
            f      = 6.213e-4;
32
 
            sq_f   = 3.861e-7;
 
31
            f      = 6.21371192237334e-4; /*  1 / (0.0254 * 12 * 5280)    */
 
32
            sq_f   = 3.86102158542446e-7; /*  1 / (0.0254 * 12 * 5280)^2  */
33
33
            break;
34
34
 
35
35
        case U_FEET:
36
 
            f      = 3.2808;
37
 
            sq_f   = 10.7639;
 
36
            f      = 3.28083989501312; /*  1 / (0.0254 * 12)    */
 
37
            sq_f   = 10.7639104167097; /*  1 / (0.0254 * 12)^2  */
38
38
            break;
39
39
    }
40
40