Loading...
Searching...
No Matches
rotate.c File Reference

GIS Library - rotate. More...

`#include <math.h>`
Include dependency graph for rotate.c:

Go to the source code of this file.

## Macros

#define | RpD ((2 * M_PI) / 360.) /* radians/degree */
#define | D2R(d)
#define | R2D(d)

## Functions

void | G_rotate_around_point (double X0, double Y0, double *X1, double *Y1, double angle)
| Rotate point (double version).
void | G_rotate_around_point_int (int X0, int Y0, int *X1, int *Y1, double angle)
| Rotate point (int version).

## Detailed Description

GIS Library - rotate.

(C) 2001-2014 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
  Hamish Bowman, Glynn Clements

Definition in file rotate.c.

## Macro Definition Documentation

## D2R

#define D2R | ( |  | d | ) |

Value:
(double)(d * RpD) /* degrees->radians */
RpD
#define RpD
Definition rotate.c:17

Definition at line 18 of file rotate.c.

Referenced by G_rotate_around_point().

## R2D

#define R2D | ( |  | d | ) |

Value:
(double)(d / RpD) /* radians->degrees */

Definition at line 19 of file rotate.c.

## RpD

#define RpD ((2 * M_PI) / 360.) /* radians/degree */

Definition at line 17 of file rotate.c.

## Function Documentation

## G_rotate_around_point()

void G_rotate_around_point | ( | double | X0,
|  | double | Y0,
|  | double * | X1,
|  | double * | Y1,
|  | double | angle )

Rotate point (double version).

Given a point, angle, and origin, rotate the point around the origin by the given angle. Coordinates and results are double prec floating point.

Parameters

  | X0 | X component of origin (center of circle)
  | Y0 | Y component of origin (center of circle)
  [out] | X1 | X component of point to be rotated (variable is modified!)
  [out] | Y1 | Y component of point to be rotated (variable is modified!)
  | angle | in degrees, measured CCW from east

Definition at line 33 of file rotate.c.

References D2R.

Referenced by G_rotate_around_point_int(), and stroke_chain().

## G_rotate_around_point_int()

void G_rotate_around_point_int | ( | int | X0,
|  | int | Y0,
|  | int * | X1,
|  | int * | Y1,
|  | double | angle )

Rotate point (int version).

Given a point, angle, and origin, rotate the point around the origin by the given angle. Coordinates are given in integer and results are rounded back to integer.

Parameters

  | X0 | X component of origin (center of circle)
  | Y0 | Y component of origin (center of circle)
  [out] | X1 | X component of point to be rotated (variable is modified!)
  [out] | Y1 | Y component of point to be rotated (variable is modified!)
  | angle | in degrees, measured CCW from east

Definition at line 60 of file rotate.c.

References G_rotate_around_point(), and x.