|
GRASS 8 Programmer's Manual
8.5.0dev(2025)-9d806b45d8
|
OGSF library - loading and manipulating surfaces. More...
#include <stdlib.h>#include <math.h>#include <string.h>#include <grass/gis.h>#include <grass/ogsf.h>
Go to the source code of this file.
Functions | |
| double | GS_geodistance (double *from, double *to, const char *units) |
| Calculate distance between 2 coordinates. More... | |
| float | GS_distance (float *from, float *to) |
| Calculate distance. More... | |
| float | GS_P2distance (float *from, float *to) |
| Calculate distance in plane. More... | |
| void | GS_v3eq (float *v1, float *v2) |
| Copy vector values. More... | |
| void | GS_v3add (float *v1, float *v2) |
| Sum vectors. More... | |
| void | GS_v3sub (float *v1, float *v2) |
| Subtract vectors. More... | |
| void | GS_v3mult (float *v1, float k) |
| Multiple vectors. More... | |
| int | GS_v3norm (float *v1) |
| Change v1 so that it is a unit vector (3D) More... | |
| int | GS_v2norm (float *v1) |
| Change v1 so that it is a unit vector (2D) More... | |
| int | GS_dv3norm (double *dv1) |
| Changes v1 so that it is a unit vector. More... | |
| int | GS_v3normalize (float *v1, float *v2) |
| Change v2 so that v1v2 is a unit vector. More... | |
| int | GS_v3dir (float *v1, float *v2, float *v3) |
| Get a normalized direction from v1 to v2, store in v3. More... | |
| void | GS_v2dir (float *v1, float *v2, float *v3) |
| Get a normalized direction from v1 to v2, store in v3 (2D) More... | |
| void | GS_v3cross (float *v1, float *v2, float *v3) |
| Get the cross product v3 = v1 cross v2. More... | |
| void | GS_v3mag (float *v1, float *mag) |
| Magnitude of vector. More... | |
| int | GS_coordpair_repeats (float *p1, float *p2, int nhist) |
| ADD. More... | |
OGSF library - loading and manipulating surfaces.
GRASS OpenGL gsurf OGSF Library
(C) 1999-2008 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.
Definition in file gs_util.c.
| int GS_coordpair_repeats | ( | float * | p1, |
| float * | p2, | ||
| int | nhist | ||
| ) |
| float GS_distance | ( | float * | from, |
| float * | to | ||
| ) |
Calculate distance.
| [in] | from | 'from' point (X,Y,Z) |
| [in] | to | 'to' point (X,Y,Z) |
Definition at line 141 of file gs_util.c.
Referenced by GS_look_here(), gs_setlos_enterdata(), gsd_zup_twist(), and gv_line_length().
| int GS_dv3norm | ( | double * | dv1 | ) |
| double GS_geodistance | ( | double * | from, |
| double * | to, | ||
| const char * | units | ||
| ) |
Calculate distance between 2 coordinates.
Units is one of:
Default is meters.
| [in] | from | starting point (X,Y) |
| [in] | to | ending point (X,Y) |
| [in] | units | map units |
Definition at line 55 of file gs_util.c.
References Gs_distance().
| float GS_P2distance | ( | float * | from, |
| float * | to | ||
| ) |
Calculate distance in plane.
| [in] | from | 'from' point (X,Y) |
| [in] | to | 'to' point (X,Y) |
Definition at line 160 of file gs_util.c.
Referenced by gv_line_length(), and seg_intersect_vregion().
| void GS_v2dir | ( | float * | v1, |
| float * | v2, | ||
| float * | v3 | ||
| ) |
| int GS_v2norm | ( | float * | v1 | ) |
| void GS_v3add | ( | float * | v1, |
| float * | v2 | ||
| ) |
| void GS_v3cross | ( | float * | v1, |
| float * | v2, | ||
| float * | v3 | ||
| ) |
| int GS_v3dir | ( | float * | v1, |
| float * | v2, | ||
| float * | v3 | ||
| ) |
Get a normalized direction from v1 to v2, store in v3.
| [in] | v1 | first 3D vector (X,Y,Z) |
| [in] | v2 | second 3D vector (X,Y,Z) |
| [out] | v3 | output 3D vector (X,Y,Z) |
Definition at line 351 of file gs_util.c.
Referenced by GS_get_viewdir(), gs_setlos_enterdata(), and gsd_get_zup().
| void GS_v3eq | ( | float * | v1, |
| float * | v2 | ||
| ) |
Copy vector values.
v1 = v2
| [out] | v1 | first 3D vector (X,Y,Z) |
| [in] | v2 | second 3D vector (X,Y,Z) |
Definition at line 178 of file gs_util.c.
Referenced by gpd_obj(), GS_get_from(), GS_get_from_real(), GS_get_to(), Gs_save_3dview(), gsd_check_focus(), gsd_zup_twist(), and gsdrape_get_allsegments().
| void GS_v3mag | ( | float * | v1, |
| float * | mag | ||
| ) |
| void GS_v3mult | ( | float * | v1, |
| float | k | ||
| ) |
Multiple vectors.
v1 *= k
| [in,out] | v1 | 3D vector (X,Y,Z) |
| [in] | k | multiplicator |
Definition at line 229 of file gs_util.c.
Referenced by Gs_save_3dview(), gs_setlos_enterdata(), and gsd_check_focus().
| int GS_v3norm | ( | float * | v1 | ) |
| int GS_v3normalize | ( | float * | v1, |
| float * | v2 | ||
| ) |