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

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

?? vectorset.java

?? java 作圖的程序
?? JAVA
字號(hào):
package graph;import java.awt.*;import java.applet.*;import java.util.*;import java.lang.*;/*******************************************************************************    Class  VectorSet******************************************************************************    Copyright (C) 1996 Leigh Brookshaw****    This program is free software; you can redistribute it and/or modify**    it under the terms of the GNU General Public License as published by**    the Free Software Foundation; either version 2 of the License, or**    (at your option) any later version.****    This program is distributed in the hope that it will be useful,**    but WITHOUT ANY WARRANTY; without even the implied warranty of**    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the**    GNU General Public License for more details.****    You should have received a copy of the GNU General Public License**    along with this program; if not, write to the Free Software**    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.******************************************************************************    This class extends the DataSet class to vectors***************************************************************************//** *  This class is designed to hold vectors to be plotted. It extends the  *  DataSet class. *  The vectors are defined as (x,y,dx,dy) where (x,y) is the position *  of the vector tail and (dx,dy) is the relative position of the head. *  It is to be used in conjunction with the Graph2D class and Axis  *  class for plotting 2D graphs. * * @version $Revision: 1.3 $, $Date: 1996/10/23 03:30:22 $ * @author Leigh Brookshaw  */public class VectorSet extends DataSet {  /**   * The Default stride of the Vector class   */     private final static int VECTOR_STRIDE    = 4;  /**   * Boolean set if legend is to be drawn   */     private boolean drawlegend = false;/****************************** Public Static Values     **************************/  /**   * A constant value flag used to specify if the mean magnitude of the   * vectors is going to be used as the scaling variable   */     public final static int MEAN    = 1;  /**   * A constant value flag used to specify if the minimum magnitude of the   * vectors is going to be used as the scaling variable   */     public final static int MINIMUM = 2;  /**   * A constant value flag used to specify if the max magnitude of the   * vectors is going to be used as the scaling variable   */     public final static int MAXIMUM = 3;/************************** Public Variables      **********************/   /**   * This is the scaling to be used when drawing vectors. The scaling is the   * fraction of the axis the mean vector magnitude will be scaled to.   */     public double scale = 0.1;/************************ Protected Variables      **********************/  /**   * This is the stride of the data in the data array. For a vector set   * it will be 4.   */     protected int stride = VECTOR_STRIDE;  /**   * The flag specifying which scaling variable to use   */     protected int scalingType = 1;/************************ Private Variables*********************/  /**   * The mean magnitude squared of the vectors   */     private double vmean;  /**   * The minimum magnitude squared of the vectors   */     private double vmin;  /**   * The maximum magnitude squared of the vectors   */     private double vmax;/************************ Constructors********************/  /**   *  Instantiate an empty data set.   * @exception  Exception   *            A Generic exception if it fails to instantiate the   *            the class with the correct stride.   */      public VectorSet ( ) throws Exception {               super(VECTOR_STRIDE);              stride = VECTOR_STRIDE;      };  /**   * Instantiate a DataSet with the parsed data.   * The double array contains the data.    * The data is stored in the array in the sequence   * <PRE>   *             x,y,dx,dy,x,y,dx,dy,...   * </PRE>   * Where (x,y) is the position of the tail and (dx,dy) is the relative   * position of the head.   * This means that the length of the data   * array is 4*n.   * @param d Array containing the (x,y,dy,dx) vectors.   * @param n Number of (x,y) data pairs in the array.   * @exception  Exception   *            A Generic exception if it fails to load the   *            parsed array into the class.   */      public VectorSet ( double d[], int n ) throws Exception {            super(d,n,VECTOR_STRIDE);            this.stride = VECTOR_STRIDE;      }  /**   *  Instantiate an empty data set.   * @param s The scaling to use when plotting the vectors.   * @exception  Exception   *            A Generic exception if it fails to instantiate the   *            the class with the correct stride.   */      public VectorSet (double scale) throws Exception{               super(VECTOR_STRIDE);               this.scale = scale;      }  /**   * Instantiate a DataSet with the parsed data.   * @param d Array containing the (x,y,dy,dx) vectors.   * @param n Number of (x,y,dx,dy) vectors in the array.   * @exception  Exception   *            A Generic exception if it fails to load the   *            parsed array into the class.   */      public VectorSet ( double d[], int n, double scale ) throws Exception {             this(d,n);             this.scale = scale;      }/********************** Public Methods******************/  /**   * Set the scaling to use when drawing vectors   * @param scale The scaling to employ   */   public void setScale(double scale) {            this.scale = scale;   }  /**   * Set the scaling type to use when drawing vectors   * @param type Either MEAN, MAXIMUM or MINIMUM.   */   public void setScalingType(int type) {     if(type == MEAN || type == MAXIMUM || type == MINIMUM)            scalingType = type;   }  /**   *  return the current scaling factor. That is the calculated scaling   *  using the axis range the mean/max/min magnitude and the percentage   *  scale.   */    public double getScaleFactor() {        double f;        if( xrange > yrange )  f = scale*yrange;        else                   f = scale*xrange;        if(vmean <= 0.0) return 1.0;                if( scalingType == MEAN    )  return f/vmean;         if( scalingType == MINIMUM )  return f/vmin;         if( scalingType == MAXIMUM )  return f/vmax;        return 1.0;    }  /**   * Draw a Vector legend in the graph window. The legend will be placed   * above the data window in the center   */       public void legend() {           super.legend(-1,-1,null);           drawlegend = true;      }  /**   * Define a Vector legend in the graph window. The legend will be placed   * above the data window in the center   * @param text text to display in the legend   */       public void legend(String text) {           super.legend(-1,-1,text);           drawlegend = true;      }  /**   * Define a Vector legend in the graph window   * @param x    pixel position of the legend.   * @param y    pixel position of the legend.   * @param text text to display in the legend   */       public void legend(int x, int y, String text) {           super.legend(x,y,text);           drawlegend = true;      }  /**   * Define a Vector legend in the graph window   * @param x    data position of the legend.   * @param y    data position of the legend.   * @param text text to display in the legend   */       public void legend(double x, double y, String text) {           super.legend(x,y,text);           drawlegend = true;      }  /**   * Draw the vectors at the data points.   * If this data has been attached to an Axis then scale the data   * based on the axis maximum/minimum otherwise scale using   * the data's maximum/minimum   * @param g Graphics state   * @param bounds The data window to draw into   */      public void draw_data(Graphics g, Rectangle bounds) {           Color c;           if ( xaxis != null ) {                xmax = xaxis.maximum;                xmin = xaxis.minimum;           }           if ( yaxis != null ) {                ymax = yaxis.maximum;                ymin = yaxis.minimum;           }                      xrange = xmax - xmin;           yrange = ymax - ymin;	   /*	   ** draw the legend before we clip the data window	   */           draw_legend(g,bounds);	   /*	   ** Clip the data window	   */           if(clipping) g.clipRect(bounds.x, bounds.y,                           bounds.width, bounds.height);           c = g.getColor();           if ( linecolor != null) g.setColor(linecolor);           else                    g.setColor(c);           drawVectors(g,bounds);           g.setColor(c);      }  /**   * Draw a legend for this Vector set   * @param g Graphics context   * @param w Data Window   */      protected void draw_legend(Graphics g, Rectangle w) {          Color c = g.getColor();          TextLine value = new TextLine();          double dx;          int ix,iy;          int length;          if(!drawlegend) return;	  /*	  ** Calculate the vector magnitude of a line legend_length          ** pixels long. This will be our standard vector	  */          dx = xrange*((double)legend_length)/((double)w.width)                        /getScaleFactor();          value.parseDouble(dx,3);	  /*	  ** Calculate the length of the legend	  */          length = legend_length+value.getWidth(g)+value.charWidth(g,' ');	  /*	  ** Calculate the position of the legend if needed.	  */          if( legend_ix == 0 && legend_iy == 0 ) {             legend_ix = (int)(w.x + ((legend_dx-xmin)/xrange)*w.width);             legend_iy = (int)(w.y + (1.0 - (legend_dy-ymin)/yrange)*w.height);	  } else if( legend_ix == -1 && legend_iy == -1 ) {             legend_ix = w.x + w.width/2 - length/2;              legend_iy = w.y - value.getAscent(g)/2 ;	  }	  /*	  ** In what follows the vector tail is the zero point. It is on	  ** the right - the vector points to the left	  */          if ( linecolor != null) g.setColor(linecolor);	  /*	  ** Draw the standard vector	  */          g.drawLine(legend_ix,legend_iy,legend_ix+legend_length,legend_iy);          ix = legend_ix + (int)(0.25*(double)legend_length+0.5);          iy = legend_iy - (int)(0.25*(double)legend_length+0.5);           g.drawLine(legend_ix,legend_iy,ix,iy);          ix = legend_ix + (int)(0.25*(double)legend_length+0.5);          iy = legend_iy + (int)(0.25*(double)legend_length+0.5);           g.drawLine(legend_ix,legend_iy,ix,iy);	  /*	  ** Add the value of the standard vector. To the right of the vector	  */          value.draw(g, legend_ix+legend_length+value.charWidth(g,' '),                        iy, TextLine.LEFT);	  /*	  ** Add any legend text (above the vector) that might have been	  ** defined.	  */          g.setColor(c);          if( legend_text != null && !legend_text.isNull() ) {               legend_text.draw( g,legend_ix + length/2,                                   iy-value.getAscent(g)                        -legend_text.getDescent(g)-legend_text.getLeading(g)                        , TextLine.CENTER);          }      }/************************ Protected Methods*********************/      protected void drawVectors(Graphics g, Rectangle w) {        int ix0,iy0;        int ix1,iy1;        double x0,y0,x1,y1,dx,dy;//      Is there any data to draw? Sometimes the draw command will//      will be called before any data has been placed in the class.        if( data == null || data.length < stride ) return;//      Lets draw the vectors        for(int i=0; i<length; i+=stride) {           x0 = data[i];           y0 = data[i+1];           dx = data[i+2]*getScaleFactor();           dy = data[i+3]*getScaleFactor();           x1 = x0 + dx;           y1 = y0 + dy;           if( inside(x0,y0) || inside(x1,y1) ) {              ix0 = (int)(w.x + ((x0-xmin)/xrange)*w.width);              iy0 = (int)(w.y + (1.0 - (y0-ymin)/yrange)*w.height);                           ix1 = (int)(w.x + ((x1-xmin)/xrange)*w.width);              iy1 = (int)(w.y + (1.0 - (y1-ymin)/yrange)*w.height);              g.drawLine(ix0,iy0,ix1,iy1);              /*	      ** Now draw the head of the vector. To avoid scaling problems              ** the head is drawn using pixel units. This would not work              ** if we had multiple output devices.              */              dx = (double)(ix1-ix0);              dy = (double)(iy1-iy0);              ix0 = ix1 - (int)(0.25*(dx-dy)+0.5);              iy0 = iy1 - (int)(0.25*(dx+dy)+0.5);               g.drawLine(ix0,iy0,ix1,iy1);              ix0 = ix1 - (int)(0.25*(dx+dy)+0.5);              iy0 = iy1 - (int)(0.25*(-dx+dy)+0.5);               g.drawLine(ix0,iy0,ix1,iy1);           }        }           }  /**   * Calculate the range of the data and the magnitude of the vectors.   * This modifies dxmin,dxmax,dymin,dymax   * and xmin,xmax,ymin,ymax   */      protected void range(int stride) {           int i;           double mag = 0.0;           if( length > stride ) {              dxmax = data[0];              dymax = data[1];              dxmin = dxmax;              dymin = dymax;              mag = data[2]*data[2] + data[3]*data[3];              vmean = Math.sqrt(mag);              vmin  = mag;              vmax  = mag;           } else {               dxmin = 0.0;               dxmax = 0.0;               dymin = 0.0;               dymax = 0.0;               vmean = 0.0;               vmin  = 0.0;               vmax  = 0.0;           }           for(i=stride; i<length; i+=stride ) {             if( dxmax < data[i] )   { dxmax = data[i]; }             else             if( dxmin > data[i] )   { dxmin = data[i]; }             if( dymax < data[i+1] ) { dymax = data[i+1]; }             else             if( dymin > data[i+1] ) { dymin = data[i+1]; }             mag = data[i+2]*data[i+2] + data[i+3]*data[i+3];             vmean += Math.sqrt(mag);             if( vmin > mag ) vmin = mag;             if( vmax < mag ) vmax = mag;           }           if(length > stride ) {                            vmin  = Math.sqrt(vmin);                            vmax  = Math.sqrt(vmax);                            vmean = vmean/dataPoints();           }           if( xaxis == null) {              xmin = dxmin;              xmax = dxmax;           }           if( yaxis == null) {              ymin = dymin;              ymax = dymax;           }     }}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91丨porny丨在线| 69成人精品免费视频| 中文字幕中文字幕一区| 欧美高清视频不卡网| 成人美女视频在线看| 国产一区二区三区免费播放| 天天色 色综合| 亚洲国产日韩一区二区| 亚洲自拍偷拍九九九| 亚洲综合在线第一页| 国产黑丝在线一区二区三区| 国产一区二区三区免费观看| 欧美日本国产视频| 91精品婷婷国产综合久久性色| 国产精品女同一区二区三区| 亚洲免费视频成人| 亚洲综合激情小说| hitomi一区二区三区精品| 91老司机福利 在线| 国产日韩欧美精品一区| 国产精品美女视频| 国产高清精品网站| 欧美成人综合网站| 国产亚洲一区字幕| 国产精品久久久久久户外露出| 九一九一国产精品| 国产不卡在线视频| 欧美视频精品在线观看| 91精品在线免费| 亚洲国产成人tv| 欧美天堂一区二区三区| 亚洲黄色小视频| 国产主播一区二区| 欧美在线免费视屏| 欧美成人vps| 美美哒免费高清在线观看视频一区二区| 精品在线观看免费| 精品国产亚洲一区二区三区在线观看| 久久久国产精品麻豆| 一区二区三区蜜桃网| 黄色小说综合网站| 久久久久久97三级| 不卡的av中国片| 91精品国产综合久久精品麻豆| 91麻豆精品91久久久久久清纯| 亚洲v日本v欧美v久久精品| 青娱乐精品在线视频| 91在线观看视频| 一区二区三区美女视频| 欧美日韩国产一二三| 免费高清在线一区| 国产亚洲人成网站| 99riav一区二区三区| 精品国产一区二区三区久久久蜜月 | 亚洲国产经典视频| 亚洲午夜影视影院在线观看| 欧美日韩免费观看一区二区三区| 2020国产精品| 五月天一区二区| 日韩欧美在线123| 亚洲一区二区三区四区五区黄| 欧美日韩www| 国产精品一二二区| 日韩精品一区二区三区老鸭窝 | 2020国产精品自拍| 99r国产精品| 欧美a一区二区| 国产精品麻豆99久久久久久| 欧美日韩一级二级三级| 国产乱码精品一区二区三区av | www激情久久| 在线观看91视频| 久久国产精品色婷婷| 91精品国产综合久久香蕉的特点 | www.亚洲在线| 婷婷久久综合九色综合绿巨人| 精品少妇一区二区三区免费观看 | 久久99精品久久久久久| 亚洲精品网站在线观看| 欧美va在线播放| 欧美亚洲综合久久| 国产激情视频一区二区在线观看 | 国产精品18久久久久久久久| 午夜精品一区在线观看| 国产精品毛片久久久久久| 91精品国产色综合久久久蜜香臀| 成人爽a毛片一区二区免费| 亚洲大片精品永久免费| 国产精品久久久久久久裸模| 日韩三级视频中文字幕| 欧美日韩一区久久| 91在线视频18| 国产米奇在线777精品观看| 一级中文字幕一区二区| 国产精品久久国产精麻豆99网站| 欧美一区二区大片| 欧美剧在线免费观看网站| 成人午夜免费视频| 激情综合色综合久久| 日韩高清在线观看| 欧美成人性福生活免费看| 欧美三级电影精品| 91同城在线观看| 成人免费毛片高清视频| 国产精品一二三四| 国产一区二区三区四区在线观看| 蜜桃一区二区三区在线观看| 五月激情综合色| 亚洲自拍偷拍av| 亚洲国产一区在线观看| 亚洲另类在线视频| 伊人一区二区三区| 亚洲欧美另类久久久精品| 国产精品久久久久久亚洲伦| 国产精品久久影院| 综合欧美一区二区三区| 欧美一区二区三区在线观看 | 精品国产露脸精彩对白| 日韩欧美成人一区二区| 日韩欧美国产wwwww| 欧美一二三区在线观看| 91麻豆精品91久久久久久清纯| 欧美日韩三级视频| 91麻豆精品国产91久久久久久久久| 欧美日韩一区二区三区不卡| 欧美日本在线播放| 日韩一区二区精品葵司在线| 欧美一卡二卡三卡| 精品国产乱码久久久久久久久| 欧美精品一区二区三区高清aⅴ | 国产精品性做久久久久久| 国产在线不卡一区| 成人一区二区视频| 色综合天天综合色综合av| 日韩精品乱码免费| 亚洲桃色在线一区| 亚洲成人免费电影| 精品一区二区三区欧美| 成人禁用看黄a在线| 在线免费观看一区| 日韩女优电影在线观看| 国产日韩成人精品| 亚洲制服丝袜av| 青青草国产精品亚洲专区无| 国产激情一区二区三区桃花岛亚洲| www..com久久爱| 欧美日韩中文字幕一区二区| 欧美岛国在线观看| 亚洲日本va午夜在线影院| 日韩精品国产欧美| 不卡的电影网站| 欧美一级二级三级乱码| 国产清纯白嫩初高生在线观看91 | 日韩va欧美va亚洲va久久| 精品亚洲欧美一区| 91在线视频在线| 日韩精品在线网站| 一区二区三区资源| 国产精品羞羞答答xxdd| 欧美日韩国产综合一区二区| 久久久国产一区二区三区四区小说 | 亚洲电影视频在线| 风间由美一区二区三区在线观看 | 色婷婷久久一区二区三区麻豆| 国产露脸91国语对白| 色视频欧美一区二区三区| 日韩色在线观看| 亚洲一二三级电影| 成人一区二区视频| 久久综合久久综合九色| 亚洲一区二区三区四区在线免费观看| 国产黄色精品视频| 精品久久久久久亚洲综合网| 亚洲一区在线观看网站| 91在线观看视频| 国产亚洲欧美一级| 蜜臀av性久久久久av蜜臀妖精 | 精品国产亚洲一区二区三区在线观看| 亚洲人亚洲人成电影网站色| 国产在线精品不卡| 日韩三级伦理片妻子的秘密按摩| 一级特黄大欧美久久久| www.亚洲精品| 国产精品麻豆一区二区| 国产精品888| 久久先锋影音av鲁色资源| 日韩av中文在线观看| 精品视频在线免费观看| 亚洲男人的天堂在线aⅴ视频| 国产99精品国产| 久久久久久毛片| 久久精品国产一区二区三| 欧美军同video69gay| 日韩综合在线视频| 欧美日免费三级在线| 亚洲一级不卡视频| 欧美性受xxxx黑人xyx| 亚洲国产欧美日韩另类综合| 在线中文字幕一区| 欧美videossexotv100|