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

# gimpmath

## Name

gimpmath -- Mathematical definitions and macros.

## Synopsis

    #define     FINITE                          (x)
    #define     G_PI
    #define     G_PI_2
    #define     G_PI_4
    #define     G_SQRT2
    #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

### FINITE()

    #define     FINITE(x)

`x` : |

### G_PI

    #define G_PI    3.14159265358979323846

### G_PI_2

    #define G_PI_2  1.57079632679489661923

### G_PI_4

    #define G_PI_4  0.78539816339744830962

### G_SQRT2

    #define G_SQRT2 1.4142135623730951

### 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 >>>
gimplimits | GIMP Library