/*
 * File: glibrary.c
 * Last modified on Wed Jul 20 14:30:26 1994 by eroberts
 * -----------------------------------------------------
 * This file implements the simple functions in the glibrary.h
 * interface.
 */

#include <stdio.h>
#include <math.h>
#include "genlib.h"

/* Constants */

#define Pi 3.1415926535

/* Exported entries */

double Radians(double degrees)
{
    return (degrees * Pi / 180);
}

double Degrees(double radians)
{
    return (radians * 180 / Pi);
}

int Round(double x)
{
    return ((int) floor(x + 0.5));
}

int Min(int x, int y)
{
    return ((x < y) ? x : y);
}

int Max(int x, int y)
{
    return ((x > y) ? x : y);
}

double MinF(double x, double y)
{
    return ((x < y) ? x : y);
}

double MaxF(double x, double y)
{
    return ((x > y) ? x : y);
}
