BRL-CAD
tplot.c File Reference

This routine is designed to simplify the creation of

X, Y plots for user. More...

#include "common.h"
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "vmath.h"
#include "plot3.h"
Include dependency graph for tplot.c:

Go to the source code of this file.

Macros

#define TIC   100
 
#define REF_WIDTH   0.857143
 
#define NUM_DISTANCE   250
 
#define LAB_LNGTH   860
 

Functions

void tp_sep (float x, float *coef, int *ex)
 tp_sep() divides a floating point number into a coefficient and an exponent. Works in base ten. More...
 
double tp_ipow (double x, int n)
 tp_ipow() raises a floating point number to a positive integer power. XXX Horribly inefficient! More...
 
void tp_fixsc (float *x, int npts, float size, float *xs, float *xmin, float *xmax, float *dx)
 
void tp_plot (FILE *fp, int xp, int yp, int xl, int yl, char *xtitle, char *ytitle, float *x, float *y, int n, double cscale)
 
void tp_ftoa (float x, char *s)
 This routine converts a floating point number into a string of ascii characters of the form "sX.XXXesXX". The string is null terminated. More...
 
void PL_FORTRAN (fplot, FPLOT)
 

Detailed Description

This routine is designed to simplify the creation of

X, Y plots for user.

George W. Hartwig, Jr. 16 March 1979

This routine is designed to simplify the creation of X, Y plots for user. The user need only furnish this program with the data arrays to be plotted, the lengths of the respective axis, titles for the axis, and the point on the page corresponding to data point (0, 0). The program will then do everything else required to make the plot appear on the user's terminal including scaling of the data, centering of the titles and positioning on the page.

where

  • int xp, yp page point corresponding to (0, 0) of the data
  • int xl, yl lengths of the x and y axis, respectively
  • char xtitle[], ytitle[] titles for the axis
  • float x[], y[] the floating point data arrays
  • int n the number of points in the data arrays

Definition in file tplot.c.