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

# GimpMath

## Name

GimpMath -- Mathematical definitions and macros.

## Synopsis

    #define     G_MAXRAND
    #define     RINT                            (x)
    #define     ROUND                           (x)
    #define     SQR                             (x)
    #define     MAX255                          (a)
    #define     CLAMP0255                       (a)
    #define     gimp_deg_to_rad                 (angle)
    #define     gimp_rad_to_deg                 (angle)

## Description

Mathematical definitions and macros.

## Details

### G_MAXRAND

    #define     G_MAXRAND

### RINT()

    #define     RINT(x)

`x` : |

### ROUND()

    #define ROUND(x) ((int) ((x) + 0.5))

`x` : |

### SQR()

    #define SQR(x) ((x) * (x))

`x` : |

### MAX255()

    #define MAX255(a)  ((a) | (((a) & 256) - (((a) & 256) >> 8)))

`a` : |

### CLAMP0255()

    #define CLAMP0255(a)  CLAMP(a,0,255)

`a` : |

### gimp_deg_to_rad()

    #define gimp_deg_to_rad(angle) ((angle) * (2.0 * G_PI) / 360.0)

`angle` : |

### gimp_rad_to_deg()

    #define gimp_rad_to_deg(angle) ((angle) * 360.0 / (2.0 * G_PI))

`angle` : |

<<< Previous Page | Home | Up | Next Page >>>
GIMP Math Library | GimpMatrix