<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 97,  comments - 93,  trackbacks - 0

    本程序未優化,比較好的方法是,進行曲線積分,算誤差比進行方程約束,由于時間比較少,稍候會給出優化程序。

     1 package com.ibm.nicky.PLR;
     2 
     3 /**
     4  * @author Qu Qiang
     5  * 
     6  */
     7 public class PLR {
     8     public static final double LIMIT = 0.09;
     9 
    10     PLR() {
    11     }
    12 
    13     /**
    14      * @param args
    15      */
    16     public static void main(String[] args) {
    17 
    18         Point[] parray = { new Point(35), new Point(46), new Point(56),
    19                 new Point(66.8), new Point(77.9) };
    20         int temp = 0;
    21         double max = 0.0;
    22         double x1 = parray[0].getX();
    23         double y1 = parray[0].getY();
    24         double x2 = parray[parray.length - 1].getX();
    25         double y2 = parray[parray.length - 1].getY();
    26         double y1my2 = y1 - y2;
    27         double x2mx2 = x2 - x1;
    28         double C = y2 * x1 - y1 * x2;
    29         double length = Math.sqrt(Math.pow((double) (y2 - y1), 2.0)
    30                 + Math.pow((double) (x2 - x1), 2.0));
    31         System.out.println(length);
    32         double d[] = new double[10];
    33         for (int i = 1; i < parray.length - 1; i++) {
    34 
    35             double x = parray[i].getX();
    36             double y = parray[i].getY();
    37 
    38             d[i] = Math.abs(x * y1my2 + y * x2mx2 + C) / length;
    39         }
    40         for (int i = 1; i < parray.length - 1; i++) {
    41             max = d[1];
    42             if (d[i] > max) {
    43                 max = d[i];
    44                 temp = i;
    45             }
    46         }
    47         if (max >= LIMIT) {
    48             System.out.println("this point x=" + parray[temp].getX()
    49                     + " is the target point");
    50         }
    51         double k1 = (parray[temp].getY() - y1) / (parray[temp].getX() - x1);
    52         double k2 = (y2 - parray[temp].getY()) / (x2 - parray[temp].getX());
    53         double b1 = y1 - k1 * x1;
    54         double b2 = y2 - k2 * x2;
    55         System.out.println("the first line is y=" + k1 + "x+" + b1);
    56         System.out.println("the second line is y=" + k2 + "x+" + b2);
    57     }
    58 }



     1 package com.ibm.nicky.plr;
     2 
     3 /**
     4  * @author Qu Qiang
     5  * 
     6  */
     7 
     8 public class Point {
     9     
    10   private double x;
    11   private double y;
    12   Point(double x,double y){
    13       this.x=x;
    14       this.y=y;
    15   }
    16   public double getX(){return this.x;}
    17   public double getY(){return this.y;}
    18 }
    19 

    http://www.gotoread.com/s/e/?vo=1858&p=60
    posted on 2007-08-14 17:27 wqwqwqwqwq 閱讀(1006) 評論(0)  編輯  收藏 所屬分類: Data Structure && Algorithm
    <2007年8月>
    2930311234
    567891011
    12131415161718
    19202122232425
    2627282930311
    2345678




    常用鏈接

    留言簿(10)

    隨筆分類(95)

    隨筆檔案(97)

    文章檔案(10)

    相冊

    J2ME技術網站

    java技術相關

    mess

    搜索

    •  

    最新評論

    閱讀排行榜

    校園夢網網絡電話,中國最優秀的網絡電話
    主站蜘蛛池模板: 亚洲永久精品ww47| 久久精品国产亚洲AV无码娇色 | 久久综合九色综合97免费下载| 人禽杂交18禁网站免费| 亚洲国产精品一区第二页| 老司机午夜在线视频免费| 最近2019中文字幕免费看最新| 亚洲AV午夜福利精品一区二区 | 亚洲AV噜噜一区二区三区| 四虎永久在线精品免费网址 | 国产精品成人免费观看| 亚洲天堂免费在线视频| 成人亚洲国产va天堂| 91在线视频免费看| 亚洲婷婷天堂在线综合| 91精品免费高清在线| 久久精品亚洲综合| 麻豆精品不卡国产免费看| 国产亚洲情侣一区二区无| 成人免费一区二区三区| 亚洲毛片网址在线观看中文字幕 | 亚洲中文字幕视频国产| h视频在线免费观看| 国产成人A亚洲精V品无码| 另类图片亚洲校园小说区| 免费无遮挡无码永久在线观看视频| 亚洲中文无码亚洲人成影院| 国内免费高清在线观看| 亚洲一区欧洲一区| 毛片免费观看网址| 亚洲国产成人久久一区二区三区| 国产精品成人免费综合| 一级毛片a免费播放王色电影| 国产成人A亚洲精V品无码| a级日本高清免费看| 亚洲视频在线一区二区三区| 男女做羞羞的事视频免费观看无遮挡| 亚洲国产成人久久三区| 热99re久久免费视精品频软件| 国产成人亚洲精品蜜芽影院| 亚洲一级片内射网站在线观看|