/*
 *
 *                        plotinit.c
 *
 */
 
#include "defn.h"

plotinit()
{
    /*
     * Initialisation of PostScript plot macros 
     */
    MOVE = "M";
    RMOVE = "R";
    DRAW = "D";
    RDRAW = "I";


    /*
     *  plotter resolution in [ plotter unit / mm ]
     */
    RESOLUTION = 40.14;   
    /*
     * Page offsets set to zero
     */
    xoffset = yoffset = 0;
    /*
     * Define degree to radian parameter
     */
    deg_rad = asin(1.0) / 90.0;
    /*
     * Define  radian to degree parameter
     */
    rad_deg = 90.0 / asin(1.0);

    /*
     * Laser Printer paper - A4 size
     */
    A4Width = 210.0;              /*  mm  */
    A4Height = 297.0;             /*  mm  */

    /*
     * Laser Printer paper - A3 size
     */
    A3Width = 297.0;              /*  mm  */
    A3Height = 420.0;             /*  mm  */

    /*
     * Maximum plotting range of HPGL (7475) plotter in mm
     */
    MaxA4RangeX = 11040 / RESOLUTION;      /* 274.6  mm */
    MaxA4RangeY = 7721 / RESOLUTION;       /* 192.1  mm */
    MaxA3RangeX = 16158 / RESOLUTION;      /* 401.9  mm */
    MaxA3RangeY = 11040 / RESOLUTION;      /* 274.6  mm */

/*
 * default HPGL stuff
 */
	
    PLOTABS = TRUE;		/* Absolute plot coordinates */

    PENDOWN = FALSE;		/* Penup */

    SETDOT = FALSE;		/* HP-GL only for linetype = 0 */
    LINE_STYLE = SOLID_LINE;

    SYMBOLX = FALSE;		/* HP-GL only */

    USER_UNITS = FALSE;         /* Plotter units */

    EOL = '\003';		/* End of line terminator default */

    ROTATE_STATE = FALSE;       /* rotation state  */

    CURR_LB_PT = FALSE;         /* current point for labeling -> see defn.h */

    /*
     * Default character specifications
     */
    char_angle = 0;		/* Degrees ->  direction */
    char_tan = 0;		/* tan(angle) */
    SR_bad = FALSE;             /* flag to change relative char size after
				   IP instruction; used in redefineP1P2():
				   user_unit.c                            */  
    rel_WIDTH = DEFWIDTH;
    rel_HEIGHT = DEFHEIGHT;

    /*
     * Default ticks specification
     */
    urTICK = 0.5;
    dlTICK = 0.5;

    /* 
     * Default Fill Type instruction parameters
     */
    FILL_TYPE = 1;
    FILL_ANGLE = 0;
    FILL_SPACING = pow((U2x - U1x), 2.0) + pow((U2y - U1y), 2.0);
    FILL_SPACING = pow(FILL_SPACING, 0.5);
    FILL_SPACING /= 100;     /*   this is 1 pc of diagonal distance between
				    P1 and P2 in plotter units   */

    /*
     * Default Pen Thickness
     */
    PEN_THICKNESS = 0.3;        /* mm */

}
