GIMP Math Library Reference Manual
<<< Previous Page | Home | Up | Next Page >>>

# GimpVector

## Name

GimpVector -- Utilities to set up and manipulate vectors.

## Synopsis

    struct      GimpVector2;
    struct      GimpVector3;
    struct      GimpVector4;
    gdouble     gimp_vector2_inner_product      (GimpVector2 *vector1,
                                                 GimpVector2 *vector2);
    gdouble     gimp_vector2_inner_product_val  (GimpVector2 vector1,
                                                 GimpVector2 vector2);
    GimpVector2 gimp_vector2_cross_product      (GimpVector2 *vector1,
                                                 GimpVector2 *vector2);
    GimpVector2 gimp_vector2_cross_product_val  (GimpVector2 vector1,
                                                 GimpVector2 vector2);
    gdouble     gimp_vector2_length             (GimpVector2 *vector);
    gdouble     gimp_vector2_length_val         (GimpVector2 vector);
    void        gimp_vector2_normalize          (GimpVector2 *vector);
    GimpVector2 gimp_vector2_normalize_val      (GimpVector2 vector);
    void        gimp_vector2_mul                (GimpVector2 *vector,
                                                 gdouble factor);
    GimpVector2 gimp_vector2_mul_val            (GimpVector2 vector,
                                                 gdouble factor);
    void        gimp_vector2_sub                (GimpVector2 *result,
                                                 GimpVector2 *vector1,
                                                 GimpVector2 *vector2);
    GimpVector2 gimp_vector2_sub_val            (GimpVector2 vector1,
                                                 GimpVector2 vector2);
    void        gimp_vector2_set                (GimpVector2 *vector,
                                                 gdouble x,
                                                 gdouble y);
    GimpVector2 gimp_vector2_new_val            (gdouble x,
                                                 gdouble y);
    void        gimp_vector2_add                (GimpVector2 *result,
                                                 GimpVector2 *vector1,
                                                 GimpVector2 *vector2);
    GimpVector2 gimp_vector2_add_val            (GimpVector2 vector1,
                                                 GimpVector2 vector2);
    void        gimp_vector2_neg                (GimpVector2 *vector);
    GimpVector2 gimp_vector2_neg_val            (GimpVector2 vector);
    void        gimp_vector2_rotate             (GimpVector2 *vector,
                                                 gdouble alpha);
    GimpVector2 gimp_vector2_rotate_val         (GimpVector2 vector,
                                                 gdouble alpha);
    gdouble     gimp_vector3_inner_product      (GimpVector3 *vector1,
                                                 GimpVector3 *vector2);
    gdouble     gimp_vector3_inner_product_val  (GimpVector3 vector1,
                                                 GimpVector3 vector2);
    GimpVector3 gimp_vector3_cross_product      (GimpVector3 *vector1,
                                                 GimpVector3 *vector2);
    GimpVector3 gimp_vector3_cross_product_val  (GimpVector3 vector1,
                                                 GimpVector3 vector2);
    gdouble     gimp_vector3_length             (GimpVector3 *vector);
    gdouble     gimp_vector3_length_val         (GimpVector3 vector);
    void        gimp_vector3_normalize          (GimpVector3 *vector);
    GimpVector3 gimp_vector3_normalize_val      (GimpVector3 vector);
    void        gimp_vector3_mul                (GimpVector3 *vector,
                                                 gdouble factor);
    GimpVector3 gimp_vector3_mul_val            (GimpVector3 vector,
                                                 gdouble factor);
    void        gimp_vector3_sub                (GimpVector3 *result,
                                                 GimpVector3 *vector1,
                                                 GimpVector3 *vector2);
    GimpVector3 gimp_vector3_sub_val            (GimpVector3 vector1,
                                                 GimpVector3 vector2);
    void        gimp_vector3_set                (GimpVector3 *vector,
                                                 gdouble x,
                                                 gdouble y,
                                                 gdouble z);
    GimpVector3 gimp_vector3_new                (gdouble x,
                                                 gdouble y,
                                                 gdouble z);
    void        gimp_vector3_add                (GimpVector3 *result,
                                                 GimpVector3 *vector1,
                                                 GimpVector3 *vector2);
    GimpVector3 gimp_vector3_add_val            (GimpVector3 vector1,
                                                 GimpVector3 vector2);
    void        gimp_vector3_neg                (GimpVector3 *vector);
    GimpVector3 gimp_vector3_neg_val            (GimpVector3 vector);
    void        gimp_vector3_rotate             (GimpVector3 *vector,
                                                 gdouble alpha,
                                                 gdouble beta,
                                                 gdouble gamma);
    GimpVector3 gimp_vector3_rotate_val         (GimpVector3 vector,
                                                 gdouble alpha,
                                                 gdouble beta,
                                                 gdouble gamma);
    void        gimp_vector_2d_to_3d            (gint sx,
                                                 gint sy,
                                                 gint w,
                                                 gint h,
                                                 gint x,
                                                 gint y,
                                                 GimpVector3 *vp,
                                                 GimpVector3 *p);
    GimpVector3 gimp_vector_2d_to_3d_val        (gint sx,
                                                 gint sy,
                                                 gint w,
                                                 gint h,
                                                 gint x,
                                                 gint y,
                                                 GimpVector3 vp,
                                                 GimpVector3 p);
    void        gimp_vector_3d_to_2d            (gint sx,
                                                 gint sy,
                                                 gint w,
                                                 gint h,
                                                 gdouble *x,
                                                 gdouble *y,
                                                 GimpVector3 *vp,
                                                 GimpVector3 *p);

## Description

Utilities to set up and manipulate vectors.

## Details

### struct GimpVector2

    struct GimpVector2
    {
      gdouble x, y;
    };

### struct GimpVector3

    struct GimpVector3
    {
      gdouble x, y, z;
    };

### struct GimpVector4

    struct GimpVector4
    {
      gdouble x, y, z, w;
    };

### gimp_vector2_inner_product ()

    gdouble     gimp_vector2_inner_product      (GimpVector2 *vector1,
                                                 GimpVector2 *vector2);

`vector1` : |
`vector2` : |
Returns : |

### gimp_vector2_inner_product_val ()

    gdouble     gimp_vector2_inner_product_val  (GimpVector2 vector1,
                                                 GimpVector2 vector2);

`vector1` : |
`vector2` : |
Returns : |

### gimp_vector2_cross_product ()

    GimpVector2 gimp_vector2_cross_product      (GimpVector2 *vector1,
                                                 GimpVector2 *vector2);

`vector1` : |
`vector2` : |
Returns : |

### gimp_vector2_cross_product_val ()

    GimpVector2 gimp_vector2_cross_product_val  (GimpVector2 vector1,
                                                 GimpVector2 vector2);

`vector1` : |
`vector2` : |
Returns : |

### gimp_vector2_length ()

    gdouble     gimp_vector2_length             (GimpVector2 *vector);

`vector` : |
Returns : |

### gimp_vector2_length_val ()

    gdouble     gimp_vector2_length_val         (GimpVector2 vector);

`vector` : |
Returns : |

### gimp_vector2_normalize ()

    void        gimp_vector2_normalize          (GimpVector2 *vector);

`vector` : |

### gimp_vector2_normalize_val ()

    GimpVector2 gimp_vector2_normalize_val      (GimpVector2 vector);

`vector` : |
Returns : |

### gimp_vector2_mul ()

    void        gimp_vector2_mul                (GimpVector2 *vector,
                                                 gdouble factor);

`vector` : |
`factor` : |

### gimp_vector2_mul_val ()

    GimpVector2 gimp_vector2_mul_val            (GimpVector2 vector,
                                                 gdouble factor);

`vector` : |
`factor` : |
Returns : |

### gimp_vector2_sub ()

    void        gimp_vector2_sub                (GimpVector2 *result,
                                                 GimpVector2 *vector1,
                                                 GimpVector2 *vector2);

`result` : |
`vector1` : |
`vector2` : |

### gimp_vector2_sub_val ()

    GimpVector2 gimp_vector2_sub_val            (GimpVector2 vector1,
                                                 GimpVector2 vector2);

`vector1` : |
`vector2` : |
Returns : |

### gimp_vector2_set ()

    void        gimp_vector2_set                (GimpVector2 *vector,
                                                 gdouble x,
                                                 gdouble y);

`vector` : |
`x` : |
`y` : |

### gimp_vector2_new_val ()

    GimpVector2 gimp_vector2_new_val            (gdouble x,
                                                 gdouble y);

`x` : |
`y` : |
Returns : |

### gimp_vector2_add ()

    void        gimp_vector2_add                (GimpVector2 *result,
                                                 GimpVector2 *vector1,
                                                 GimpVector2 *vector2);

`result` : |
`vector1` : |
`vector2` : |

### gimp_vector2_add_val ()

    GimpVector2 gimp_vector2_add_val            (GimpVector2 vector1,
                                                 GimpVector2 vector2);

`vector1` : |
`vector2` : |
Returns : |

### gimp_vector2_neg ()

    void        gimp_vector2_neg                (GimpVector2 *vector);

`vector` : |

### gimp_vector2_neg_val ()

    GimpVector2 gimp_vector2_neg_val            (GimpVector2 vector);

`vector` : |
Returns : |

### gimp_vector2_rotate ()

    void        gimp_vector2_rotate             (GimpVector2 *vector,
                                                 gdouble alpha);

`vector` : |
`alpha` : |

### gimp_vector2_rotate_val ()

    GimpVector2 gimp_vector2_rotate_val         (GimpVector2 vector,
                                                 gdouble alpha);

`vector` : |
`alpha` : |
Returns : |

### gimp_vector3_inner_product ()

    gdouble     gimp_vector3_inner_product      (GimpVector3 *vector1,
                                                 GimpVector3 *vector2);

`vector1` : |
`vector2` : |
Returns : |

### gimp_vector3_inner_product_val ()

    gdouble     gimp_vector3_inner_product_val  (GimpVector3 vector1,
                                                 GimpVector3 vector2);

`vector1` : |
`vector2` : |
Returns : |

### gimp_vector3_cross_product ()

    GimpVector3 gimp_vector3_cross_product      (GimpVector3 *vector1,
                                                 GimpVector3 *vector2);

`vector1` : |
`vector2` : |
Returns : |

### gimp_vector3_cross_product_val ()

    GimpVector3 gimp_vector3_cross_product_val  (GimpVector3 vector1,
                                                 GimpVector3 vector2);

`vector1` : |
`vector2` : |
Returns : |

### gimp_vector3_length ()

    gdouble     gimp_vector3_length             (GimpVector3 *vector);

`vector` : |
Returns : |

### gimp_vector3_length_val ()

    gdouble     gimp_vector3_length_val         (GimpVector3 vector);

`vector` : |
Returns : |

### gimp_vector3_normalize ()

    void        gimp_vector3_normalize          (GimpVector3 *vector);

`vector` : |

### gimp_vector3_normalize_val ()

    GimpVector3 gimp_vector3_normalize_val      (GimpVector3 vector);

`vector` : |
Returns : |

### gimp_vector3_mul ()

    void        gimp_vector3_mul                (GimpVector3 *vector,
                                                 gdouble factor);

`vector` : |
`factor` : |

### gimp_vector3_mul_val ()

    GimpVector3 gimp_vector3_mul_val            (GimpVector3 vector,
                                                 gdouble factor);

`vector` : |
`factor` : |
Returns : |

### gimp_vector3_sub ()

    void        gimp_vector3_sub                (GimpVector3 *result,
                                                 GimpVector3 *vector1,
                                                 GimpVector3 *vector2);

`result` : |
`vector1` : |
`vector2` : |

### gimp_vector3_sub_val ()

    GimpVector3 gimp_vector3_sub_val            (GimpVector3 vector1,
                                                 GimpVector3 vector2);

`vector1` : |
`vector2` : |
Returns : |

### gimp_vector3_set ()

    void        gimp_vector3_set                (GimpVector3 *vector,
                                                 gdouble x,
                                                 gdouble y,
                                                 gdouble z);

`vector` : |
`x` : |
`y` : |
`z` : |

### gimp_vector3_new ()

    GimpVector3 gimp_vector3_new                (gdouble x,
                                                 gdouble y,
                                                 gdouble z);

`x` : |
`y` : |
`z` : |
Returns : |

### gimp_vector3_add ()

    void        gimp_vector3_add                (GimpVector3 *result,
                                                 GimpVector3 *vector1,
                                                 GimpVector3 *vector2);

`result` : |
`vector1` : |
`vector2` : |

### gimp_vector3_add_val ()

    GimpVector3 gimp_vector3_add_val            (GimpVector3 vector1,
                                                 GimpVector3 vector2);

`vector1` : |
`vector2` : |
Returns : |

### gimp_vector3_neg ()

    void        gimp_vector3_neg                (GimpVector3 *vector);

`vector` : |

### gimp_vector3_neg_val ()

    GimpVector3 gimp_vector3_neg_val            (GimpVector3 vector);

`vector` : |
Returns : |

### gimp_vector3_rotate ()

    void        gimp_vector3_rotate             (GimpVector3 *vector,
                                                 gdouble alpha,
                                                 gdouble beta,
                                                 gdouble gamma);

`vector` : |
`alpha` : |
`beta` : |
`gamma` : |

### gimp_vector3_rotate_val ()

    GimpVector3 gimp_vector3_rotate_val         (GimpVector3 vector,
                                                 gdouble alpha,
                                                 gdouble beta,
                                                 gdouble gamma);

`vector` : |
`alpha` : |
`beta` : |
`gamma` : |
Returns : |

### gimp_vector_2d_to_3d ()

    void        gimp_vector_2d_to_3d            (gint sx,
                                                 gint sy,
                                                 gint w,
                                                 gint h,
                                                 gint x,
                                                 gint y,
                                                 GimpVector3 *vp,
                                                 GimpVector3 *p);

`sx` : |
`sy` : |
`w` : |
`h` : |
`x` : |
`y` : |
`vp` : |
`p` : |

### gimp_vector_2d_to_3d_val ()

    GimpVector3 gimp_vector_2d_to_3d_val        (gint sx,
                                                 gint sy,
                                                 gint w,
                                                 gint h,
                                                 gint x,
                                                 gint y,
                                                 GimpVector3 vp,
                                                 GimpVector3 p);

`sx` : |
`sy` : |
`w` : |
`h` : |
`x` : |
`y` : |
`vp` : |
`p` : |
Returns : |

### gimp_vector_3d_to_2d ()

    void        gimp_vector_3d_to_2d            (gint sx,
                                                 gint sy,
                                                 gint w,
                                                 gint h,
                                                 gdouble *x,
                                                 gdouble *y,
                                                 GimpVector3 *vp,
                                                 GimpVector3 *p);

`sx` : |
`sy` : |
`w` : |
`h` : |
`x` : |
`y` : |
`vp` : |
`p` : |

## See Also

GimpMatrix3

GimpMatrix4

<<< Previous Page | Home | Up | Next Page >>>
GimpMatrix | GimpMD5