Changes between Version 13 and Version 14 of UsersWikiplpgsqlfunctions


Ignore:
Timestamp:
Sep 10, 2009, 2:05:21 PM (15 years ago)
Author:
bcrosby
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • UsersWikiplpgsqlfunctions

    v13 v14  
    2626        endpointutm := st_transform(endpoint,utmzone(endpoint));
    2727
    28         midpointrads := abs(st_azimuth(startpointutm,arcenterutm) - st_azimuth(endpointutm,arcenterutm))/2;
     28        midpointrads := abs(st_azimuth(arcenterutm,startpointutm) - st_azimuth(arcenterutm,endpointutm))/2;
    2929        IF direction = 'cw' THEN thedirection := -1*midpointrads; ELSE thedirection := midpointrads; END IF;
    3030        pointonarc := ST_Translate( ST_Rotate( ST_Translate( startpointutm, -1*ST_X(arcenterutm), -1*ST_Y(arcenterutm)), thedirection), ST_X(arcenterutm), ST_Y(arcenterutm));
     
    3434  $$
    3535  LANGUAGE 'plpgsql' IMMUTABLE;
    36   COMMENT ON FUNCTION st_createarc(geometry,geometry,geometry,text) IS 'Generates an arc based on starting point, ending point, centre of arc, and direction (clockwise: 'cw', counter-clockwise: 'cc'). All geometries must be of type POINT and this function returns a linestring of the arc based on the original SRID and 32 points per quarter circle. Requires the utmzone function.';
     36  COMMENT ON FUNCTION st_createarc(geometry,geometry,geometry,text) IS 'Generates an arc based on starting point, ending point, centre of arc, and direction (clockwise: \'cw\', conter-clockwise: \'cc\'). All geometries must be of type POINT and this function returns a linestring of the arc based on the original SRID and 32 points per quarter circle. Requires the utmzone function.';
     37
    3738
    3839}}}