亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? grid.c

?? ngspice又一個電子CAD仿真軟件代碼.功能更全
?? C
?? 第 1 頁 / 共 3 頁
字號:
/**********Copyright 1990 Regents of the University of California.  All rights reserved.Modified: 2001 AlansFixes$Id: grid.c,v 1.5 2005/05/30 20:28:44 sjborley Exp $**********//*     Routines to draw the various sorts of grids -- linear, log, polar.*/#include <ngspice.h>#include <graph.h>#include <cpdefs.h>#include <ftedefs.h>#include "grid.h"#include "../display.h"#define RAD_TO_DEG	(180.0 / M_PI)#define LABEL_CHARS	20/* static declarations */static double * lingrid(GRAPH *graph, double lo, double hi, double delta, int type, Axis axis);static double * loggrid(GRAPH *graph, double lo, double hi, int type, Axis axis);static void polargrid(GRAPH *graph);static void drawpolargrid(GRAPH *graph);static void adddeglabel(GRAPH *graph, int deg, int x, int y, int cx, int cy, int lx, int ly);static void addradlabel(GRAPH *graph, int lab, double theta, int x, int y);static void smithgrid(GRAPH *graph);static void drawsmithgrid(GRAPH *graph);static void arcset(GRAPH *graph, double rad, double prevrad, double irad, double iprevrad, 		   double radoff, int maxrad, int centx, int centy, int xoffset, int yoffset, 		   char *plab, char *nlab, int pdeg, int ndeg, int pxmin, int pxmax);static double cliparc(double cx, double cy, double rad, double start, double end, int iclipx, 		      int iclipy, int icliprad, int flag);/* note: scaleunits is static and never changed in this file    ie, can get rid of it */static bool scaleunits = TRUE;voidgr_fixgrid(GRAPH *graph, double xdelta, double ydelta, int xtype, int ytype){    double *dd;    if (graph->grid.gridtype == GRID_NONE) {        graph->grid.gridtype = GRID_LIN;    }    SetColor(1);    SetLinestyle(1);    if ((graph->data.xmin > graph->data.xmax)            || (graph->data.ymin > graph->data.ymax)) {      fprintf(cp_err,         "gr_fixgrid: Internal Error - bad limits: %g, %g, %g, %g\r\n",        graph->data.xmin, graph->data.xmax,         graph->data.ymin, graph->data.ymax);      return;    }    if (graph->grid.gridtype == GRID_POLAR) {        graph->grid.circular = TRUE;        polargrid(graph);        return;    } else if (graph->grid.gridtype == GRID_SMITH        || graph->grid.gridtype == GRID_SMITHGRID)    {        graph->grid.circular = TRUE;        smithgrid(graph);        return;    }    graph->grid.circular = FALSE;    if ((graph->grid.gridtype == GRID_YLOG)            || (graph->grid.gridtype == GRID_LOGLOG))        dd = loggrid(graph, graph->data.ymin, graph->data.ymax,                ytype, y_axis);    else        dd = lingrid(graph, graph->data.ymin, graph->data.ymax,                ydelta, ytype, y_axis);    graph->datawindow.ymin = dd[0];    graph->datawindow.ymax = dd[1];    if ((graph->grid.gridtype == GRID_XLOG)            || (graph->grid.gridtype == GRID_LOGLOG))        dd = loggrid(graph, graph->data.xmin, graph->data.xmax,                xtype, x_axis);    else        dd = lingrid(graph, graph->data.xmin, graph->data.xmax,                xdelta, xtype, x_axis);    graph->datawindow.xmin = dd[0];    graph->datawindow.xmax = dd[1];/* do we really need this? *//*    SetLinestyle(0);    DrawLine(graph->viewportxoff, graph->viewportyoff,            graph->viewport.width + graph->viewportxoff,            graph->viewportyoff);    DrawLine(graph->viewportxoff, graph->viewportyoff,            graph->viewportxoff,            graph->viewport.height + graph->viewportyoff);    SetLinestyle(1);*/    return;}voidgr_redrawgrid(GRAPH *graph){    SetColor(1);    SetLinestyle(1);    /* draw labels */    if (graph->grid.xlabel) {      Text(graph->grid.xlabel,          (int) (graph->absolute.width * 0.35),          graph->fontheight);    }    if (graph->grid.ylabel) {    	  if (graph->grid.gridtype == GRID_POLAR     	          || graph->grid.gridtype == GRID_SMITH    	          || graph->grid.gridtype == GRID_SMITHGRID) {              Text(graph->grid.ylabel,                   graph->fontwidth,		   (graph->absolute.height * 3) / 4 );	  } else {              Text(graph->grid.ylabel,                   graph->fontwidth,		   graph->absolute.height / 2 );	  }    }    switch( graph->grid.gridtype ) {	case GRID_POLAR:        	drawpolargrid(graph);		break;	case GRID_SMITH:        	drawsmithgrid(graph);		break;	case GRID_SMITHGRID:        	drawsmithgrid(graph);		break;		    	case GRID_XLOG:        case GRID_LOGLOG:        	drawloggrid(graph,               		graph->grid.xaxis.log.units,			graph->grid.xaxis.log.hmt,               		graph->grid.xaxis.log.lmt,                	graph->grid.xaxis.log.decsp,                	graph->grid.xaxis.log.subs,                	graph->grid.xaxis.log.pp, x_axis);		break;	default:        	drawlingrid(graph,               		graph->grid.xaxis.lin.units,               		graph->grid.xaxis.lin.spacing,               		graph->grid.xaxis.lin.numspace,               		graph->grid.xaxis.lin.distance,               		graph->grid.xaxis.lin.lowlimit,               		graph->grid.xaxis.lin.highlimit,               		graph->grid.xaxis.lin.onedec,               		graph->grid.xaxis.lin.mult,               		graph->grid.xaxis.lin.tenpowmag               		/ graph->grid.xaxis.lin.tenpowmagx,               		graph->grid.xaxis.lin.digits,               		x_axis);		break;     }    switch( graph->grid.gridtype ) {	case GRID_POLAR:	case GRID_SMITH:	case GRID_SMITHGRID:		break;    	case GRID_YLOG:        case GRID_LOGLOG:        	drawloggrid(graph,                	graph->grid.yaxis.log.units,			graph->grid.yaxis.log.hmt,                	graph->grid.yaxis.log.lmt,                	graph->grid.yaxis.log.decsp,                	graph->grid.yaxis.log.subs,                	graph->grid.yaxis.log.pp, y_axis);		break;	default:        	drawlingrid(graph,                	graph->grid.yaxis.lin.units,                	graph->grid.yaxis.lin.spacing,                	graph->grid.yaxis.lin.numspace,                	graph->grid.yaxis.lin.distance,                	graph->grid.yaxis.lin.lowlimit,                	graph->grid.yaxis.lin.highlimit,                	graph->grid.yaxis.lin.onedec,                	graph->grid.yaxis.lin.mult,               		graph->grid.yaxis.lin.tenpowmag               		/ graph->grid.yaxis.lin.tenpowmagx,               		graph->grid.yaxis.lin.digits,                	y_axis);		break;     }}/* Plot a linear grid. Returns the new hi and lo limits. */static double *lingrid(GRAPH *graph, double lo, double hi, double delta, int type, Axis axis){    int mag, mag2, mag3;    double hmt, lmt, dst;    int nsp;    double tenpowmag = 0.0, tenpowmag2, step, spacing;    bool onedec = FALSE;    int margin;    int max;    static double dd[2];    int mult = 1;    char buf[LABEL_CHARS], *s;    int slim, digits;    if (axis == y_axis && graph->grid.ysized) {	lmt = graph->grid.yaxis.lin.lowlimit;	hmt = graph->grid.yaxis.lin.highlimit;	tenpowmag = graph->grid.yaxis.lin.tenpowmag;	dd[0] = lmt * tenpowmag;	dd[1] = hmt * tenpowmag;	return dd;    }    if (axis == x_axis && graph->grid.xsized) {	lmt = graph->grid.xaxis.lin.lowlimit;	hmt = graph->grid.xaxis.lin.highlimit;	tenpowmag = graph->grid.xaxis.lin.tenpowmag;	dd[0] = lmt * tenpowmag;	dd[1] = hmt * tenpowmag;	return dd;    }    if (delta < 0.0) {        fprintf(cp_err, "Warning: %cdelta is negative -- reversed\n",                (axis == x_axis) ? 'x' : 'y');        delta = -delta;    }    mag2 = floor(log10(fabs(hi - lo)));    tenpowmag2 = pow(10.0, (double) mag2);    /* Round lo down, and hi up */    /* First, round lo _up_ and hi _down_ out to the 3rd digit of accuracy */    lmt = (ceil(1000 * lo / tenpowmag2)) / 1000.0;    hmt = (floor(1000 * hi / tenpowmag2 + 0.9)) / 1000.0;    lmt = floor(10.0 * lmt) / 10.0;    hmt = ceil(10.0 * hmt) / 10.0;    lo = lmt * tenpowmag2;    hi = hmt * tenpowmag2;    if (fabs(hi) > fabs(lo))    	mag = floor(log10(fabs(hi)));    else    	mag = floor(log10(fabs(lo)));    if (mag >= 0)	mag3 = ((int) (mag / 3)) * 3;    else	mag3 = - ((int) ((2 - mag) / 3)) * 3;    if (scaleunits)	digits = mag3 - mag2;    else {	digits = mag - mag2;	mag3 = mag;    }    if (digits < 1)	digits = 0;    if (axis == x_axis) {      margin = graph->viewportxoff;      /*max = graph->viewport.width + graph->viewportxoff;*/      max = graph->absolute.width - graph->viewportxoff;    } else {      graph->viewportxoff = (digits + 5 + mag - mag3) * graph->fontwidth;      margin = graph->viewportyoff;      /*max = graph->viewport.height + graph->viewportyoff;*/      max = graph->absolute.height - graph->viewportyoff;    }    /* Express the difference between the high and low values as     * diff = d * 10^mag. We know diff >= 0.0.  If scaleunits is     * set then make sure that mag is modulo 3.     */    dst = hmt - lmt;    /* We have to go from lmt to hmt, so think of some useful places     * to put grid lines. We will have a total of nsp lines, one     * every spacing pixels, which is every dst / nsp units.     */    if (scaleunits) {	static char scaleletters[ ] = "afpnum\0kMGT";	char	*p;	int	i, j;        tenpowmag = pow(10.0, (double) mag3);	*buf = 0;	i = (mag3 + 18) / 3;	if (i < 0)		i = 6; /* No scale units */	else if (i >= sizeof(scaleletters) - 1) {		/* sizeof includes '\0' at end, which is useless */		/* i = sizeof(scaleletters) - 2; */		i = 6; /* No scale units */	}	j = mag3 - i * 3 + 18;	if (j == 1)		(void) sprintf(buf, "x10 ");	else if (j == 2)		(void) sprintf(buf, "x100 ");	else if (j)		(void) sprintf(buf, "x10^%d ", j);	if (scaleletters[i]) {		for (p = buf; *p; p++)			;		*p++ = scaleletters[i];		*p++ = 0;	}    } else if (mag > 1) {        tenpowmag = pow(10.0, (double) mag);	(void) sprintf(buf, "x10^%d ", mag);    }    if ((s = ft_typabbrev(type))) {	(void) strcat(buf, s);    } else {	(void) strcat(buf, "Units");    }    if (delta == 0.0) {	int	i;	double	step;	static struct { float div_lim, step; } div_list[ ] = {		{ 100.0, 10.0 },		{ 50.0, 5.0 },		{ 20.0, 2.0 },		{ 6.0, 1.0 },		{ 3.0, 0.5 },		{ 1.0, 0.2 },		{ 0.5, 0.1 },		{ 0.0, 0.05 },		{ 0.0, 0.01 }	};	for (i = 0; i < NUMELEMS(div_list); i++) {		if (dst > div_list[i].div_lim) {			break;		}	}	do {		step = div_list[i].step;		nsp = (dst + step - 0.0001) / step;		spacing = (max - margin) / nsp;		i += 1;	} while (i < NUMELEMS(div_list) && spacing > 50);	if (axis == x_axis) {		slim = digits + 5 + mag - mag3;	        slim = graph->fontwidth * (slim + 1);	} else	    slim = graph->fontheight * 3;	while (i > 0 && spacing < slim + 3) {		i -= 1;		step = div_list[i].step;		nsp = (dst + step - 0.0001) / step;		spacing = (max - margin) / nsp;	}	if (lmt < 0)		lmt = - ceil(-lmt / step) * step;	else		lmt = floor(lmt / step) * step;	if (hmt < 0)		hmt = - floor(-hmt / step) * step;	else		hmt = ceil(hmt / step) * step;	dst = hmt - lmt;	lo = lmt * tenpowmag2;	hi = hmt * tenpowmag2;	nsp = (dst + step - 0.0001) / step;    } else {	/* The user told us where to put the grid lines.  They will	 * not be equally spaced in this case (i.e, the right edge	 * won't be a line).	 */	nsp = (hi - lo) / delta;	if (nsp > 100)		nsp = 100;	step = (max - margin) * delta / (hi - lo);    }    spacing = (max - margin) / nsp;    dd[0] = lo;    dd[1] = hi;    /* Reset the max coordinate to deal with round-off error. */    if (nsp && (delta == 0.0)) {	if (axis == x_axis)	    graph->viewport.width = spacing * nsp;	else	    graph->viewport.height = spacing * nsp;    } else if (!nsp) {	nsp = 1;    }    /* have to save non-intuitive variables left over	from old algorithms for redraws */    if (axis == x_axis) {      graph->grid.xsized = 1;      graph->grid.xaxis.lin.onedec = onedec;      graph->grid.xaxis.lin.mult = mult;      graph->grid.xaxis.lin.tenpowmag = tenpowmag2;      graph->grid.xaxis.lin.tenpowmagx = tenpowmag;      graph->grid.xaxis.lin.digits = digits;      (void) strcpy(graph->grid.xaxis.lin.units, buf);      graph->grid.xaxis.lin.distance = dst;      graph->grid.xaxis.lin.lowlimit = lmt;      graph->grid.xaxis.lin.highlimit = hmt;      graph->grid.xaxis.lin.spacing = spacing;      graph->grid.xaxis.lin.numspace = nsp;    } else {      graph->grid.ysized = 1;      graph->grid.yaxis.lin.onedec = onedec;      graph->grid.yaxis.lin.mult = mult;      graph->grid.yaxis.lin.tenpowmag = tenpowmag2;      graph->grid.yaxis.lin.tenpowmagx = tenpowmag;      graph->grid.yaxis.lin.digits = digits;      (void) strcpy(graph->grid.yaxis.lin.units, buf);      graph->grid.yaxis.lin.distance = dst;      graph->grid.yaxis.lin.lowlimit = lmt;      graph->grid.yaxis.lin.highlimit = hmt;      graph->grid.yaxis.lin.spacing = spacing;      graph->grid.yaxis.lin.numspace = nsp;    }    return (dd);}/* PN static */voiddrawlingrid(GRAPH *graph, char *units, int spacing, int nsp, double dst, double lmt, double hmt, bool onedec, int mult, double mag, int digits, Axis axis){    int i, j;    double m, step;    char buf[LABEL_CHARS];    /* i counts how many pixels we have drawn, and j counts which unit     * we are at.     */    SetLinestyle(1);    step = floor((double) dst / nsp * 100.0 + 0.000001);    for (i = 0, m = lmt * 100.0; m - 0.001 <= hmt * 100.0;      i += spacing, m += step)    {	j = m;        if (j == 0)            SetLinestyle(0);        if (graph->grid.gridtype != GRID_NONE) {            if (axis == x_axis)                DrawLine(graph->viewportxoff + i,                  graph->viewportyoff, graph->viewportxoff + i,                  graph->viewport.height + graph->viewportyoff);            else                DrawLine(graph->viewportxoff,                  graph->viewportyoff + i,                  graph->viewport.width + graph->viewportxoff,                  graph->viewportyoff + i);        }        if (j == 0)            SetLinestyle(1);	(void) sprintf(buf, "%.*f", digits + 1, m * mag / 100.0);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区二区三区四区五区黄| 亚洲成人你懂的| 在线亚洲高清视频| 免费的成人av| 亚洲靠逼com| 久久精品无码一区二区三区| 欧美性生活一区| 成人一区二区三区中文字幕| 日韩av网站在线观看| 136国产福利精品导航| 久久婷婷成人综合色| 91精品欧美久久久久久动漫| 97精品国产露脸对白| 国产一区二区电影| 免费观看在线综合色| 亚洲一区二区在线视频| 国产精品福利在线播放| 久久免费看少妇高潮| 日韩视频中午一区| 欧美日高清视频| 色国产综合视频| www.视频一区| 国产aⅴ综合色| 国产乱子伦一区二区三区国色天香| 婷婷久久综合九色国产成人| 中文字幕亚洲一区二区va在线| 国产亚洲欧美在线| 欧美mv和日韩mv的网站| 欧美一区二区视频在线观看| 欧美亚洲高清一区二区三区不卡| av电影天堂一区二区在线观看| 国产成人精品一区二区三区四区 | 91女厕偷拍女厕偷拍高清| 国产在线播放一区二区三区 | 高清久久久久久| 国产真实乱偷精品视频免| 蜜桃久久精品一区二区| 日韩av网站在线观看| 日本中文字幕一区二区有限公司| 亚洲一卡二卡三卡四卡无卡久久| 亚洲黄色免费网站| 玉米视频成人免费看| 亚洲黄色尤物视频| 夜夜精品浪潮av一区二区三区| 亚洲欧洲综合另类在线| 亚洲免费在线播放| 一区二区三区小说| 亚洲国产精品一区二区www| 亚洲一区在线视频观看| 艳妇臀荡乳欲伦亚洲一区| 亚洲黄色av一区| 亚洲1区2区3区4区| 亚洲一区二三区| 青青国产91久久久久久| 精品一区二区影视| 国产一区不卡精品| 成人h动漫精品一区二区| 99精品视频在线观看免费| 97久久久精品综合88久久| 欧美在线免费视屏| 欧美一区二区三区四区久久| 日韩精品一区二区三区四区| 久久精品欧美日韩精品| 中文字幕一区免费在线观看| 一区二区在线电影| 日韩av中文在线观看| 国模大尺度一区二区三区| 国产超碰在线一区| 在线观看日韩高清av| 91精品国产综合久久国产大片| 精品国产91久久久久久久妲己| 欧美高清在线精品一区| 亚洲一区二区三区小说| 久久精品噜噜噜成人88aⅴ | 99精品久久久久久| 欧美日韩视频在线一区二区 | 精品一区二区久久| 成人h动漫精品一区二区| 欧美性受极品xxxx喷水| wwwwxxxxx欧美| 亚洲色图欧美在线| 麻豆久久一区二区| 成人av免费在线观看| 欧美精品日韩精品| 欧美激情一区二区三区四区| 亚洲国产精品久久人人爱| 国内成人免费视频| 欧美怡红院视频| 日本一区二区三区久久久久久久久不| 一区二区三区在线观看动漫| 久久99精品国产91久久来源| 一本久久a久久免费精品不卡| 日韩欧美在线不卡| 亚洲另类在线制服丝袜| 激情文学综合丁香| 91久久奴性调教| 久久九九99视频| 亚洲成人精品一区二区| 国产91综合网| 3d成人动漫网站| 亚洲男女一区二区三区| 国产福利一区二区三区在线视频| 欧美日韩精品电影| 亚洲三级在线看| 国产成人精品一区二区三区四区 | 亚洲高清不卡在线观看| 高清不卡在线观看av| 67194成人在线观看| 亚洲欧洲日产国码二区| 韩国精品在线观看| 欧美日韩在线三级| 国产精品久久久久久久久免费相片 | 亚洲综合视频在线| 国产99一区视频免费| 欧美va在线播放| 午夜免费久久看| 色综合久久久久久久久| 日本一区二区三区dvd视频在线| 天堂成人国产精品一区| 91成人免费在线视频| 国产精品萝li| 国产成a人亚洲精| 久久久91精品国产一区二区精品| 日韩激情中文字幕| 欧美视频在线一区二区三区| 综合网在线视频| 成人av在线资源| 中文在线免费一区三区高中清不卡| 黄一区二区三区| 精品久久久久久久久久久久久久久久久 | 免费在线成人网| 欧美日韩精品一区二区三区四区| 一区二区久久久久| 91丝袜美女网| 亚洲美女免费在线| 色综合天天综合在线视频| 亚洲视频一二三区| 91视频国产资源| 亚洲精品第一国产综合野| 91片黄在线观看| 亚洲国产精品人人做人人爽| 欧美三级电影一区| 五月天久久比比资源色| 91麻豆精品国产| 蜜臀国产一区二区三区在线播放| 欧美日韩中文一区| 日韩精品国产欧美| 欧美变态口味重另类| 国内外成人在线| 国产日韩欧美高清在线| 成人av免费在线| 亚洲欧美aⅴ...| 欧美日韩国产一二三| 琪琪一区二区三区| 久久精品亚洲精品国产欧美| 成人性生交大片免费看中文| 亚洲区小说区图片区qvod| 欧洲av在线精品| 蜜臀av性久久久久蜜臀aⅴ流畅 | 久久精品国产亚洲a| 欧美精品一区二区三区很污很色的 | 欧美激情在线免费观看| 99久久亚洲一区二区三区青草| 亚洲欧洲99久久| 欧美欧美欧美欧美首页| 精品写真视频在线观看| 国产精品天天摸av网| 欧美午夜在线一二页| 美女视频黄 久久| 国产精品夫妻自拍| 在线播放中文一区| 国产一区二区看久久| 亚洲精品成人悠悠色影视| 91精品国产一区二区| 国产成人亚洲精品狼色在线 | 一区二区日韩av| 精品久久一二三区| 色综合天天综合狠狠| 日产欧产美韩系列久久99| 久久精品欧美一区二区三区麻豆| 日本韩国精品一区二区在线观看| 久久精品国产**网站演员| 中文一区二区完整视频在线观看| 欧美日韩一区二区在线观看视频| 国内久久精品视频| 亚洲国产一二三| 欧美激情中文字幕| 欧美一级片免费看| 日本久久一区二区三区| 狠狠色丁香久久婷婷综合_中| 亚洲精选免费视频| 久久免费视频色| 欧美喷水一区二区| 91在线视频观看| 国产伦精品一区二区三区免费迷 | 久久99国产乱子伦精品免费| 亚洲欧美另类久久久精品 | 91麻豆精品国产91久久久 | 国产大陆a不卡| 婷婷综合在线观看|