DPlot_Plot, DPlot_PlotBitmap, DPlot_PlotToRect, and DPlot_AddData each pass arrays of single-precision floating point numbers to DPlot. In C and C#, these are arrays of type float, in Visual Basic jargon they are Single, and in FORTRAN they are REAL*4. Double precision (C double, VB Double, FORTRAN REAL*8) versions of these functions are identical other than the arrays and an "8" suffix for the function name: DPlot_Plot8, DPlot_PlotBitmap8, DPlot_PlotToRect8, and DPlot_AddData8. DPlot stores data in double-precision arrays, so the precision of data passed to DPlot using these functions will be preserved. For most applications single precision is sufficient. A notable exception is passing date and time values in Excel's serial format: the resolution of the date May 20, 2004 (38127 in Excel serial format - see below) is about 3.3 minutes. In other words 12 noon on that date is indistinguishable from 3 minutes past noon if the date and time are represented with single precision. The resolution for the same date using double precision is about 0.37 microseconds. DPLOTLIB Arguments This documentation describes the argument lists of the DPLOTLIB functions using C syntax and data types. The equivalent data types in other languages are shown below.
Excel 1900 Date System Serial Numbers Although DPlot will display numbers along the axes using calendar dates and/or time of day, internally the data is always represented as double precision floating point numbers. Dates and date-and-time groups in DPlot use the same mechanism for storing this data as is used by Microsoft Excel: Excel's 1900 Date System. If your application passes dates to DPlot using DPlot_Plot or similar function, those dates must be represented using this format. The following code will convert a calendar date to an Excel serial number (day and month are 1-based; January=1, December=12): if( Month > 2 ) serial=(int)(365.25*year)+(int)(30.6001*(month+1))+day-694037; else serial=(int)(365.25*(year-1))+(int)(30.6001*(month+13))+day-694037; Time of day may be added to a serial number date simply by adding the time as a fractional part of the day. 0=midnight, 0.5=noon, etc.
|