GwyXYZ: Gwyddion Library Reference Manual

## GwyXYZ GwyXYZ — Cartesian coordinates in space |

## Functions

GwyXYZ * | gwy_xyz_new ()
GwyXYZ * | gwy_xyz_copy ()
void | gwy_xyz_free ()
gdouble | gwy_xyz_len ()
gdouble | gwy_xyz_len2 ()
gdouble | gwy_xyz_dist2 ()
gdouble | gwy_xyz_dotprod ()
void | gwy_xyz_crossprod ()

## Includes

    #include <libgwyddion/gwyddion.h>

## Description

## 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.

#### Parameters

x | X-coordinate. |
y | Y-coordinate. |
z | Z-coordinate. |

#### 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.

#### Parameters

xyz | 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()`.

#### Parameters

xyz | Cartesian coordinates in space. |

### gwy_xyz_len()

    gdouble
    gwy_xyz_len (const GwyXYZ *xyz);

Computes the length of a space vector.

#### Parameters

xyz | Cartesian coordinates in space. |

#### Returns

The vector length.

### gwy_xyz_len2()

    gdouble
    gwy_xyz_len2 (const GwyXYZ *xyz);

Computes the squared length of a space vector.

#### Parameters

xyz | Cartesian coordinates in space. |

#### Returns

The squared vector length.

### gwy_xyz_dist2()

    gdouble
    gwy_xyz_dist2 (const GwyXYZ *xyz,
                   const GwyXYZ *other);

Computes the squared length of the difference of two space vectors.

#### Parameters

xyz | Cartesian coordinates in space. |
other | Cartesian coordinates in space. |

#### Returns

The squared length.

### gwy_xyz_dotprod()

    gdouble
    gwy_xyz_dotprod (const GwyXYZ *xyz,
                     const GwyXYZ *other);

Computes the inner product of two space vectors.

#### Parameters

xyz | Cartesian coordinates in space. |
other | Cartesian coordinates in space. |

#### 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.

#### Parameters

xyz | Cartesian coordinates in space. |
other | Cartesian coordinates in space. |
result | Coordinates to fill with the result. | [out]