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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pnt.java

?? Voronoi圖生成算法 ,Voronoi(沃洛諾依)多邊形網絡常常被用來做為計算機仿真模型.由于按照定義形成Voronoi多邊形網絡較難用程序實現,人們多采用Delauney(狄洛尼)三角形的方法完
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/*
 * Copyright (c) 2005 by L. Paul Chew.
 * 
 * Permission is hereby granted, without written agreement and without
 * license or royalty fees, to use, copy, modify, and distribute this
 * software and its documentation for any purpose, subject to the following 
 * conditions:
 *
 * The above copyright notice and this permission notice shall be included 
 * in all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
 * DEALINGS IN THE SOFTWARE.
 */

/**
 * Points in Euclidean space, implemented as double[].
 * 
 * Includes simple geometric operations.
 * Uses matrices; a matrix is represented as an array of Pnts.
 * Uses simplices; a simplex is represented as an array of Pnts.
 * 
 * @author Paul Chew
 * 
 * Created July 2005.  Derived from an earlier, messier version.
 */
public class Pnt {
    
    private double[] coordinates;          // The point's coordinates
    
    /**
     * Constructor.
     * @param coords the coordinates
     */
    public Pnt (double[] coords) {
        // Copying is done here to ensure that Pnt's coords cannot be altered.
        coordinates = new double[coords.length];
        System.arraycopy(coords, 0, coordinates, 0, coords.length);
    }
    
    /**
     * Constructor.
     * @param coordA
     * @param coordB
     */
    public Pnt (double coordA, double coordB) {
        this(new double[] {coordA, coordB});
    }
    
    /**
     * Constructor.
     * @param coordA
     * @param coordB
     * @param coordC
     */
    public Pnt (double coordA, double coordB, double coordC) {
        this(new double[] {coordA, coordB, coordC});
    }
    
    /**
     * Create a String for this Pnt.
     * @return a String representation of this Pnt.
     */
    public String toString () {
        if (coordinates.length == 0) return "()";
        String result = "Pnt(" + coordinates[0];
        for (int i = 1; i < coordinates.length; i++)
            result = result + "," + coordinates[i];
        result = result + ")";
        return result;
    }
    
    /**
     * Equality.
     * @param other the other Object to compare to
     * @return true iff the Pnts have the same coordinates
     */
    public boolean equals (Object other) {
        if (!(other instanceof Pnt)) return false;
        Pnt p = (Pnt) other;
        if (this.coordinates.length != p.coordinates.length) return false;
        for (int i = 0; i < this.coordinates.length; i++)
            if (this.coordinates[i] != p.coordinates[i]) return false;
        return true;
    }
    
    /**
     * HashCode.
     * @return the hashCode for this Pnt
     */
    public int hashCode () {
        int hash = 0;
        for (int i = 0; i < this.coordinates.length; i++) {
            long bits = Double.doubleToLongBits(this.coordinates[i]);
            hash = (31*hash) ^ (int)(bits ^ (bits >> 32));
        }
        return hash;
    }
    
    /* Pnts as vectors */
    
    /**
     * @return the specified coordinate of this Pnt
     * @throws ArrayIndexOutOfBoundsException for bad coordinate
     */
    public double coord (int i) {
        return this.coordinates[i];
    }
    
    /**
     * @return this Pnt's dimension.
     */
    public int dimension () {
        return coordinates.length;
    }
    
    /**
     * Check that dimensions match.
     * @param p the Pnt to check (against this Pnt)
     * @return the dimension of the Pnts
     * @throws IllegalArgumentException if dimension fail to match
     */
    public int dimCheck (Pnt p) {
        int len = this.coordinates.length;
        if (len != p.coordinates.length)
            throw new IllegalArgumentException("Dimension mismatch");
        return len;
    }
    
    /**
     * Create a new Pnt by adding additional coordinates to this Pnt.
     * @param coords the new coordinates (added on the right end)
     * @return a new Pnt with the additional coordinates
     */
    public Pnt extend (double[] coords) {
        double[] result = new double[coordinates.length + coords.length];
        System.arraycopy(coordinates, 0, result, 0, coordinates.length);
        System.arraycopy(coords, 0, result, coordinates.length, coords.length);
        return new Pnt(result);
    }
    
    /**
     * Dot product.
     * @param p the other Pnt
     * @return dot product of this Pnt and p
     */
    public double dot (Pnt p) {
        int len = dimCheck(p);
        double sum = 0;
        for (int i = 0; i < len; i++)
            sum += this.coordinates[i] * p.coordinates[i];
        return sum;
    }
    
    /**
     * Magnitude (as a vector).
     * @return the Euclidean length of this vector
     */
    public double magnitude () {
        return Math.sqrt(this.dot(this));
    }
    
    /**
     * Subtract.
     * @param p the other Pnt
     * @return a new Pnt = this - p
     */
    public Pnt subtract (Pnt p) {
        int len = dimCheck(p);
        double[] coords = new double[len];
        for (int i = 0; i < len; i++)
            coords[i] = this.coordinates[i] - p.coordinates[i];
        return new Pnt(coords);
    }
    
    /**
     * Add.
     * @param p the other Pnt
     * @return a new Pnt = this + p
     */
    public Pnt add (Pnt p) {
        int len = dimCheck(p);
        double[] coords = new double[len];
        for (int i = 0; i < len; i++)
            coords[i] = this.coordinates[i] + p.coordinates[i];
        return new Pnt(coords);
    }
    
    /**
     * Angle (in radians) between two Pnts (treated as vectors).
     * @param p the other Pnt
     * @return the angle (in radians) between the two Pnts
     */
    public double angle (Pnt p) {
        return Math.acos(this.dot(p) / (this.magnitude() * p.magnitude()));
    }
    
    /**
     * Perpendicular bisector of two Pnts.
     * Works in any dimension.  The coefficients are returned as a Pnt of one
     * higher dimension (e.g., (A,B,C,D) for an equation of the form
     * Ax + By + Cz + D = 0).
     * @param point the other point
     * @return the coefficients of the perpendicular bisector
     */
    public Pnt bisector (Pnt point) {
        int dim = dimCheck(point);
        Pnt diff = this.subtract(point);
        Pnt sum = this.add(point);
        double dot = diff.dot(sum);
        return diff.extend(new double[] {-dot / 2});
    }
    
    /* Pnts as matrices */
    
    /**
     * Create a String for a matrix.
     * @param matrix the matrix (an array of Pnts)
     * @return a String represenation of the matrix
     */
    public static String toString (Pnt[] matrix) {
        StringBuffer buf = new StringBuffer("{");
        for (int i = 0; i < matrix.length; i++) buf.append(" " + matrix[i]);
        buf.append(" }");
        return buf.toString();
    }
    
    /**
     * Compute the determinant of a matrix (array of Pnts).
     * This is not an efficient implementation, but should be adequate 
     * for low dimension.
     * @param matrix the matrix as an array of Pnts
     * @return the determinnant of the input matrix
     * @throws IllegalArgumentException if dimensions are wrong
     */
    public static double determinant (Pnt[] matrix) {
        if (matrix.length != matrix[0].dimension())

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
caoporn国产精品| 日韩国产一二三区| 欧美一区二区成人| 欧美在线一二三| 99精品在线免费| 成人免费视频免费观看| 国产曰批免费观看久久久| 男女激情视频一区| 久久精品国产99| 久久国产视频网| 韩国v欧美v亚洲v日本v| 蜜桃视频一区二区三区在线观看 | 日韩美女视频一区二区 | 国产一区不卡精品| 精品夜夜嗨av一区二区三区| 日本欧洲一区二区| 美日韩一区二区三区| 久久99国内精品| 国内精品伊人久久久久av影院| 久久99精品视频| 激情综合亚洲精品| 成人不卡免费av| 99免费精品在线| 欧美丝袜丝交足nylons| 欧美人妇做爰xxxⅹ性高电影| 欧美日韩另类国产亚洲欧美一级| 欧美日韩久久不卡| 久久综合九色综合欧美亚洲| 久久免费电影网| 一区在线中文字幕| 午夜精品免费在线| 国内外成人在线| 99精品偷自拍| 欧美一区二区三区日韩| 国产欧美日韩精品在线| 一区二区三区免费网站| 日韩精品一区第一页| 黄色精品一二区| 91亚洲资源网| 91精品国产高清一区二区三区蜜臀| 欧美成人aa大片| 综合在线观看色| 蜜桃视频在线观看一区二区| 大胆欧美人体老妇| 欧美浪妇xxxx高跟鞋交| 久久综合成人精品亚洲另类欧美| 亚洲视频中文字幕| 精品无码三级在线观看视频| www.亚洲人| 精品少妇一区二区三区视频免付费 | 欧美日韩国产另类不卡| 久久亚洲精品小早川怜子| 亚洲人成小说网站色在线| 美女视频黄久久| 色哟哟日韩精品| 国产色91在线| 青青草成人在线观看| 色呦呦国产精品| 国产精品久久精品日日| 亚洲v中文字幕| 成人免费福利片| 久久亚洲一级片| 日产国产高清一区二区三区| 91视频观看免费| 国产精品美女一区二区| 另类小说综合欧美亚洲| 欧美日本一区二区三区四区| 18成人在线视频| 国产在线播放一区| 日韩三级视频中文字幕| 午夜精品123| 欧美视频在线不卡| 亚洲精品亚洲人成人网在线播放| 国产毛片精品视频| 久久午夜羞羞影院免费观看| 丝袜美腿一区二区三区| 欧美色大人视频| 一卡二卡三卡日韩欧美| 91在线精品一区二区| 中文文精品字幕一区二区| 激情深爱一区二区| 欧美精品一区男女天堂| 久久69国产一区二区蜜臀| 欧美一区二区福利视频| 免费欧美在线视频| 日韩午夜激情免费电影| 麻豆精品久久久| 精品国精品自拍自在线| 国产在线精品一区二区三区不卡| 日韩欧美国产综合| 国产一区二区剧情av在线| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 色婷婷综合五月| 一区二区三区欧美日| 欧美日韩国产免费| 美国三级日本三级久久99| 久久综合色之久久综合| 国产精品综合一区二区| 中文在线资源观看网站视频免费不卡| 国产毛片一区二区| 中文字幕视频一区| 色香蕉久久蜜桃| 三级久久三级久久| 久久蜜臀精品av| 成人午夜激情片| 亚洲午夜激情av| 欧美一区二区久久久| 精品一区二区三区视频在线观看| 久久亚洲影视婷婷| 91免费视频网址| 日韩电影免费一区| 久久精品日产第一区二区三区高清版| 国产aⅴ综合色| 亚洲自拍偷拍av| 26uuu国产日韩综合| 91免费在线视频观看| 日韩精品一卡二卡三卡四卡无卡| www国产精品av| 欧美日韩性生活| 美国av一区二区| 中文字幕在线不卡一区| 在线播放日韩导航| 成人高清伦理免费影院在线观看| 亚洲综合一二区| 久久久精品tv| 欧美精品久久天天躁| 国产不卡在线一区| 日韩中文字幕av电影| 亚洲国产精品99久久久久久久久| 欧美日韩激情在线| 成人黄色av网站在线| 奇米精品一区二区三区四区| 中文字幕亚洲一区二区av在线| 欧美日韩国产影片| 99久久精品国产一区二区三区| 视频在线观看91| 一区二区高清在线| 国产精品乱人伦中文| 精品国产污网站| 欧美一区二区三区性视频| 91啪亚洲精品| 成人av网址在线观看| 国产另类ts人妖一区二区| 天堂久久一区二区三区| 亚洲日本va在线观看| 国产精品久久网站| 国产无一区二区| 久久婷婷国产综合国色天香 | 欧美性猛交xxxx乱大交退制版| 成人免费观看男女羞羞视频| 国产资源在线一区| 美国av一区二区| 免费成人在线网站| 免费观看一级特黄欧美大片| 亚洲国产成人高清精品| 一级女性全黄久久生活片免费| 国产精品毛片大码女人| 亚洲国产成人一区二区三区| 久久久久久久免费视频了| 精品国产一二三| 欧美精品一区二区久久婷婷| 欧美一级一级性生活免费录像| 欧美日韩精品免费观看视频| 欧美系列亚洲系列| 欧美日韩综合色| 欧美日韩dvd在线观看| 在线电影院国产精品| 91麻豆精品国产91久久久久久久久 | 欧美日韩成人一区| 欧美另类z0zxhd电影| 日韩欧美一级片| 国产亚洲婷婷免费| 国产精品激情偷乱一区二区∴| 中文成人av在线| 亚洲女子a中天字幕| 亚洲综合色在线| 日韩va欧美va亚洲va久久| 秋霞av亚洲一区二区三| 久久成人久久鬼色| 高清不卡一区二区在线| 97精品久久久午夜一区二区三区| 91免费观看视频| 制服丝袜激情欧洲亚洲| 精品国产91乱码一区二区三区 | 国产日韩欧美综合在线| 欧美国产精品劲爆| 亚洲永久免费视频| 久久成人av少妇免费| 成人一级黄色片| 欧美色精品在线视频| 久久日韩精品一区二区五区| 国产精品午夜久久| 婷婷丁香激情综合| 国产成人综合自拍| 欧美日韩国产综合一区二区三区| 精品国产99国产精品| 亚洲美女视频在线观看| 精品一区二区三区视频在线观看| 成人免费av资源| 日韩一区二区三|