qwt_math.cpp
Go to the documentation of this file.
00001 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
00002  * Qwt Widget Library
00003  * Copyright (C) 1997   Josef Wilgen
00004  * Copyright (C) 2002   Uwe Rathmann
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the Qwt License, Version 1.0
00008  *****************************************************************************/
00009 
00010 #include "qwt_math.h"
00011 
00017 double qwtGetMin( const double *array, int size )
00018 {
00019     if ( size <= 0 )
00020         return 0.0;
00021 
00022     double rv = array[0];
00023     for ( int i = 1; i < size; i++ )
00024         rv = qMin( rv, array[i] );
00025 
00026     return rv;
00027 }
00028 
00029 
00035 double qwtGetMax( const double *array, int size )
00036 {
00037     if ( size <= 0 )
00038         return 0.0;
00039 
00040     double rv = array[0];
00041     for ( int i = 1; i < size; i++ )
00042         rv = qMax( rv, array[i] );
00043 
00044     return rv;
00045 }
00046 
00052 double qwtNormalizeRadians( double radians )
00053 {
00054     double a = ::fmod( radians, 2.0 * M_PI );
00055     if ( a < 0.0 )
00056         a += 2.0 * M_PI;
00057 
00058     return a;
00059 
00060 }
00061 
00067 double qwtNormalizeDegrees( double degrees )
00068 {
00069     double a = ::fmod( degrees, 360.0 );
00070     if ( a < 0.0 )
00071         a += 360.0;
00072 
00073     return a;
00074 }


plotjuggler
Author(s): Davide Faconti
autogenerated on Wed Jul 3 2019 19:28:04