Package es.iiia.shapegrammar.utils

Examples of es.iiia.shapegrammar.utils.Vector


        return getRatio(this.intersection, pointA, pointB);
    }

    private static double getRatio(Point2D intersection, Point2D pointA, Point2D pointB) {
        try {
            Vector t1 = new Vector(pointA, intersection);
            Vector t2 = new Vector(pointB, intersection);

            double norm1 = Math.sqrt(t1.x * t1.x + t1.y * t1.y);
            double norm2 = Math.sqrt(t2.x * t2.x + t2.y * t2.y);

            return MathUtils.round(norm1 / norm2);
View Full Code Here


        // otherwise count parameters
        else {
            // first order points
            try {
                // create vectors
                Vector t1 = new Vector(
                        carrier1.getDefinition().getP1(),
                        carrier1.getDefinition().getP2());

                Vector t2 = new Vector(
                        carrier2.getDefinition().getP1(),
                        carrier2.getDefinition().getP2());

                double dot = t1.x * t2.x + t1.y * t2.y;
                double norm1 = Math.sqrt(t1.x * t1.x + t1.y * t1.y);
 
View Full Code Here

TOP

Related Classes of es.iiia.shapegrammar.utils.Vector

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.