Package chunmap.model.elem

Examples of chunmap.model.elem.Triangle


    {
        double area = 0;
        CPoint p = points.getCoordinate(0);
        for (int i = 1, n = points.size() - 1; i < n; i++)
        {
            Triangle trian = new Triangle(p, points.getCoordinate(i), points.getCoordinate(i + 1));
            area += trian.computeArea();
        }
        return area;
    }
View Full Code Here


        double he = 0;// 权和
        double yh = 0;// y的和
        CPoint p = points.startPoint();
        for (int i = 1, n = points.size() - 1; i < n; i++)
        {
            Triangle trian = new Triangle(p, points.getCoordinate(i), points.getCoordinate(i + 1));
            CPoint center = trian.computeCenter();
            double area = trian.computeArea();
            xh += area * center.getX();
            yh += area * center.getY();
            he += area;
        }
        double x = xh / he;
View Full Code Here

TOP

Related Classes of chunmap.model.elem.Triangle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.