GwyXYZ
GwyXYZ — Cartesian coordinates in space
|
|
Includes
#include <libgwyddion/gwyddion.h>
Functions
gwy_xyz_new()
GwyXYZ *
gwy_xyz_new (gdouble x,
gdouble y,
gdouble z);
Creates Cartesian coordinates in space.
This is mostly useful for language bindings.
Returns
New XYZ structure. The result should be freed using gwy_xyz_free().
gwy_xyz_copy()
GwyXYZ *
gwy_xyz_copy (const GwyXYZ *xyz);
Copies Cartesian coordinates in space.
Returns
A copy of xyz
. The result should be freed using gwy_xyz_free().
gwy_xyz_free()
void
gwy_xyz_free (GwyXYZ *xyz);
Frees Cartesian coordinates in space created with gwy_xyz_copy().
gwy_xyz_len()
gdouble
gwy_xyz_len (const GwyXYZ *xyz);
Computes the length of a space vector.
Returns
The vector length.
gwy_xyz_len2()
gdouble
gwy_xyz_len2 (const GwyXYZ *xyz);
Computes the squared length of a space vector.
Returns
The squared vector length.
gwy_xyz_dotprod()
gdouble
gwy_xyz_dotprod (const GwyXYZ *xyz,
const GwyXYZ *other);
Computes the inner product of two space vectors.
Returns
The inner product xyz
⋅other
.
gwy_xyz_crossprod()
void
gwy_xyz_crossprod (const GwyXYZ *xyz,
const GwyXYZ *other,
GwyXYZ *result);
Computes the cross-product of space vectors.
The result is filled with xyz
×other
. It may be one of the two input vectors.
Types and Values
x
gdouble x = xyz->y*other->z - xyz->z*other->y;
y
gdouble y = xyz->z*other->x - xyz->x*other->z;
z
gdouble z = xyz->x*other->y - xyz->y*other->x;