/Users/Daniel/Documents/Code/axis-rounding/Blog-Post/AxisRounding.c File Reference

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

Include dependency graph for AxisRounding.c:

Go to the source code of this file.

Functions

double MakeSpacing (double start, double stop)
 Returns the rounded spacing between axis interval (tic marks).
unsigned MakeInterval (double start, double stop)
 The number for intervals to be make upon rounding the axis.
double RoundStart (double start, double spacingRounded)
 Rounded start down to the nearest multiple of the spacing.
double RoundStop (double stop, double spacingRounded)
 Rounded stop up to the nearest multiple of the spacing.
void PrintDescription (double start, double stop, double spacing, unsigned interval)
 Sends a overview of the axis parameters to stdout.


Function Documentation

unsigned MakeInterval ( double  start,
double  stop 
)

The number for intervals to be make upon rounding the axis.

Parameters:
start The left most value of the axis.
stop The right most value of the axis.

Definition at line 68 of file AxisRounding.c.

References MakeSpacing().

Referenced by main().

Here is the call graph for this function:

double MakeSpacing ( double  start,
double  stop 
)

Returns the rounded spacing between axis interval (tic marks).

Parameters:
start The left most value of the axis.
stop The right most value of the axis.
This is a simple implemetation as such only ascending axes, where stop is greater than start, will work.

Definition at line 18 of file AxisRounding.c.

Referenced by main(), and MakeInterval().

void PrintDescription ( double  start,
double  stop,
double  spacing,
unsigned  interval 
)

Sends a overview of the axis parameters to stdout.

Parameters:
start The left most value of the axis.
stop The right most value of the axis.
spacing The number of axis units between tic marks, as returned by the MakeSpacing() function.
interval The number of tic marks along the axis, including the two both ends, s returned by the MakeInterval() function.

Definition at line 99 of file AxisRounding.c.

References RoundStart(), and RoundStop().

Referenced by main().

Here is the call graph for this function:

double RoundStart ( double  start,
double  spacingRounded 
)

Rounded start down to the nearest multiple of the spacing.

No not need to call this directly as it is called from other functions.

Parameters:
start Unrounded or rounded start value.
spacingRounded The rounded spacing value for the axis as returned by MakeSpacing().

Definition at line 85 of file AxisRounding.c.

Referenced by PrintDescription().

double RoundStop ( double  stop,
double  spacingRounded 
)

Rounded stop up to the nearest multiple of the spacing.

No not need to call this directly as it is called from other functions.

Parameters:
stop Unrounded or rounded stop value.
spacingRounded The rounded spacing value for the axis as returned by MakeSpacing().

Definition at line 92 of file AxisRounding.c.

Referenced by PrintDescription().


Generated on Tue Sep 4 19:52:29 2007 for Axis Rounding by  doxygen 1.5.2