axis.c File Reference

This routine is used to generate an axis for a graph. It draws an axis with a linear scale, places tic marks every inch, labels the tics, and uses the supplied title for the axis. More...

#include "common.h"
#include <stdio.h>
#include <math.h>
#include <strings.h>
#include "machine.h"
#include "vmath.h"
#include "plot3.h"

Include dependency graph for axis.c:

Go to the source code of this file.

Defines

#define TICK_YLEN   (char_width)
 tick is 1 character height
#define NUM_YOFF   (3*char_width)
 numbers offset from line
#define TITLE_YOFF   (5*char_width)
 title offset from line

Functions

void tp_3axis (FILE *fp, char *string, fastf_t *origin, fastf_t *rot, double length, int ccw, int ndigits, double label_start, double label_incr, double tick_separation, double char_width)
void PL_FORTRAN (f3axis, F3AXIS)


Detailed Description

This routine is used to generate an axis for a graph. It draws an axis with a linear scale, places tic marks every inch, labels the tics, and uses the supplied title for the axis.

The strategy behind this routine is to split the axis into SEGMENTS, which run from one tick to the next. The origin of the first segment (x,y), the origin of the bottom of the first tick (xbott,ybott), and the origin of the first tick label (xnum,ynum) are computed along with the delta x and delta y (xincr,yincr) which describes the interval to the start of the next tick.

Author:
Michael John Muuss
August 01, 1978
Source -
SECAD/VLD Computing Consortium, Bldg 394
The U. S. Army Ballistic Research Laboratory
Aberdeen Proving Ground, Maryland 21005-5066

Definition in file axis.c.


Define Documentation

#define TICK_YLEN   (char_width)
 

tick is 1 character height

Definition at line 70 of file axis.c.

Referenced by tp_3axis().

#define NUM_YOFF   (3*char_width)
 

numbers offset from line

Definition at line 71 of file axis.c.

Referenced by tp_3axis().

#define TITLE_YOFF   (5*char_width)
 

title offset from line

Definition at line 72 of file axis.c.

Referenced by tp_3axis().


Function Documentation

void tp_3axis FILE *  fp,
char *  string,
fastf_t origin,
fastf_t rot,
double  length,
int  ccw,
int  ndigits,
double  label_start,
double  label_incr,
double  tick_separation,
double  char_width
 

Parameters:
string  label for axis
length  length of axis
ccw  0=clockwise, !0=counter clockwise (ccw)
ndigits  # digits wide
label_start  label starting value
label_incr  label increment between ticks
tick_separation  plot distance between ticks
char_width  character scale (size)

Definition at line 78 of file axis.c.

References bn_mat_mul(), MAT4X3PNT, MAT4X3VEC, MAT_DELTAS, MAT_IDN, NEAR_ZERO, NUM_YOFF, pdv_3cont(), pdv_3move(), SMALL, TICK_YLEN, TITLE_YOFF, tp_3symbol(), VDOT, VJOIN1, VMOVE, VSCALE, VSET, VSUB2, X, Y, and Z.

Here is the call graph for this function:

void PL_FORTRAN f3axis  ,
F3AXIS 
 

Definition at line 191 of file axis.c.

References bn_mat_angles(), fp, length, MAT_IDN, string, tp_3axis(), and VSET.

Here is the call graph for this function:


Generated on Mon Sep 18 01:25:02 2006 for BRL-CAD by  doxygen 1.4.6