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

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

?? mesh_pnt.java

?? Points in Euclidean space, implemented as double[].Includes simple geometric operations.Uses matrice
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:

/**
 * 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 PC
 * 
 */
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())
            throw new IllegalArgumentException("Matrix is not square");
        boolean[] columns = new boolean[matrix.length];
        for (int i = 0; i < matrix.length; i++) columns[i] = true;
        try {return determinant(matrix, 0, columns);}
        catch (ArrayIndexOutOfBoundsException e) {
            throw new IllegalArgumentException("Matrix is wrong shape");
        }
    }
    
    /**

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产91洋老外米糕| 91在线一区二区三区| 日韩一区二区电影在线| 免费一级欧美片在线观看| 日韩一级大片在线| 国产一区二区三区在线观看免费| 久久精品视频免费| 91美女视频网站| 亚洲一区二区三区美女| 6080国产精品一区二区| 韩国在线一区二区| 亚洲欧洲另类国产综合| 欧美日韩国产一级片| 久久精品国产精品青草| 国产精品久久久久婷婷二区次| 91小视频免费观看| 婷婷开心激情综合| 亚洲精品一区二区三区香蕉 | 337p粉嫩大胆色噜噜噜噜亚洲 | 99久久综合色| 污片在线观看一区二区| 精品捆绑美女sm三区| 成人丝袜18视频在线观看| 亚洲在线成人精品| 欧美mv日韩mv国产| 色88888久久久久久影院野外| 美女国产一区二区| 日韩久久一区二区| 日韩一区二区在线播放| 成人福利视频在线看| 天天综合网天天综合色| 国产精品福利电影一区二区三区四区| 在线视频综合导航| 国产乱淫av一区二区三区| 亚洲狠狠爱一区二区三区| 久久久久9999亚洲精品| 欧美日韩第一区日日骚| 成a人片国产精品| 精品一二线国产| 亚洲一区二区三区四区不卡| 欧美激情一区三区| 91精品国产一区二区三区香蕉| 懂色中文一区二区在线播放| 日韩精品电影一区亚洲| 中文一区在线播放| 欧美成va人片在线观看| 日本电影亚洲天堂一区| 成人综合婷婷国产精品久久蜜臀| 日韩精品一区第一页| 亚洲免费在线视频| 中文幕一区二区三区久久蜜桃| 91精品久久久久久蜜臀| 91精品办公室少妇高潮对白| 国产91色综合久久免费分享| 日韩av一二三| 亚洲国产人成综合网站| 亚洲天堂2016| 欧美激情中文不卡| 国产日韩欧美亚洲| 日韩午夜中文字幕| 91麻豆精品国产91久久久更新时间| 91网址在线看| 99精品久久久久久| 国产精品69久久久久水密桃| 免费av网站大全久久| 五月婷婷色综合| 亚洲国产欧美在线| 亚洲一区二区三区四区在线观看 | 欧美日韩你懂得| 色综合天天性综合| 成人动漫一区二区| 国产v综合v亚洲欧| 成年人网站91| 91蝌蚪porny| 99视频一区二区三区| 91丨九色丨国产丨porny| 99re热视频这里只精品| 北岛玲一区二区三区四区| 成人午夜激情在线| 成人午夜视频在线| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 亚洲精品欧美在线| 亚洲男同性视频| 亚洲国产一区视频| 日韩电影免费一区| 久久爱www久久做| 国产精品资源在线看| 成人综合婷婷国产精品久久免费| 高潮精品一区videoshd| 成人av免费网站| 91社区在线播放| 在线观看区一区二| 欧美亚日韩国产aⅴ精品中极品| 欧美日韩在线综合| 欧美一级一级性生活免费录像| 日韩欧美黄色影院| 国产网站一区二区| ...xxx性欧美| 午夜成人免费视频| 九色|91porny| 成年人国产精品| 欧美日韩一区 二区 三区 久久精品| 欧美日韩精品一二三区| 美国毛片一区二区| 国产精品中文欧美| 91免费版在线看| 91精品国产高清一区二区三区蜜臀| 欧美成人免费网站| 国产精品久久久久毛片软件| 一区二区三区不卡视频| 免费观看日韩av| 99国产欧美另类久久久精品| 欧美精品v国产精品v日韩精品| 日韩精品自拍偷拍| 日韩一区欧美小说| 美国av一区二区| 91在线云播放| 26uuuu精品一区二区| 亚洲欧美福利一区二区| 蜜桃精品在线观看| 99久久精品免费观看| 欧美成人综合网站| 亚洲人成网站色在线观看| 奇米色一区二区三区四区| 国产精品亲子乱子伦xxxx裸| 久久精品72免费观看| 成人免费va视频| 欧美精品久久天天躁| 中文字幕不卡在线播放| 日韩电影在线免费看| 一本色道久久综合狠狠躁的推荐| 日韩一区二区中文字幕| 亚洲免费在线看| 国产麻豆精品在线观看| 欧美日韩电影一区| 亚洲色图视频网站| 精品一区二区三区视频在线观看| 91久久久免费一区二区| 国产亚洲精品资源在线26u| 婷婷久久综合九色综合伊人色| 99视频热这里只有精品免费| 久久先锋影音av鲁色资源网| 天堂午夜影视日韩欧美一区二区| 国产欧美日韩视频一区二区| 日韩国产欧美在线观看| 日本韩国一区二区| 欧美激情资源网| 国产精品资源在线观看| 欧美成人在线直播| 免费看日韩精品| 精品视频在线视频| 亚洲精品国产第一综合99久久| 国产精品一区二区黑丝| 欧美成人乱码一区二区三区| 首页亚洲欧美制服丝腿| 欧美三级欧美一级| 一区二区三区中文在线观看| av激情亚洲男人天堂| 欧美韩国日本不卡| 国产精品1区2区3区| 亚洲精品在线一区二区| 日本在线不卡一区| 91精品欧美综合在线观看最新| 亚洲成国产人片在线观看| 色婷婷av一区二区三区之一色屋| 亚洲欧洲国产日韩| 99久久99久久精品国产片果冻| 国产精品免费av| 99精品视频在线播放观看| 亚洲欧洲美洲综合色网| 色综合久久久久综合| 亚洲欧美自拍偷拍| 91久久免费观看| 亚洲福利视频一区二区| 欧美精品久久99久久在免费线 | 91麻豆精品国产91久久久使用方法| 亚洲一区二区三区免费视频| 亚洲你懂的在线视频| 色一区在线观看| 性做久久久久久| 欧美电影免费提供在线观看| 久久97超碰色| 国产欧美一区视频| 成人一区二区三区视频 | 亚洲激情av在线| 欧美日韩中文字幕精品| 日本美女一区二区| 久久久高清一区二区三区| eeuss国产一区二区三区| 亚洲一线二线三线视频| 欧美顶级少妇做爰| 国产一区二区毛片| 国产精品久久久久9999吃药| 91久久香蕉国产日韩欧美9色| 视频一区免费在线观看| 精品日本一线二线三线不卡| 岛国一区二区在线观看| 亚洲午夜精品久久久久久久久| 欧美一级黄色大片| 成人蜜臀av电影|