|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-b0a6d7703c
|
GIS Library - rotate. More...
#include <math.h>
Go to the source code of this file.
Macros | |
| #define | RpD ((2 * M_PI) / 360.) /* radians/degree */ |
| #define | D2R(d) (double)(d * RpD) /* degrees->radians */ |
| #define | R2D(d) (double)(d / RpD) /* radians->degrees */ |
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) | |
GIS Library - rotate.
SPDX-FileCopyrightText: 2001-2014 GRASS Development Team SPDX-License-Identifier: GPL-2.0-or-later
Definition in file rotate.c.
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.
| 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 30 of file rotate.c.
References D2R.
Referenced by G_rotate_around_point_int(), and stroke_chain().
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.
| 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 57 of file rotate.c.
References G_rotate_around_point(), and x.