Package org.graphstream.ui.geom

Examples of org.graphstream.ui.geom.Vector2.normalize()


        GraphicNode node1 = (GraphicNode) edge.getNode1();
        double off = evalEllipseRadius(edge, node0, node1, camera);
        Vector2 theDirection = new Vector2(node1.getX() - node0.getX(),
            node1.getY() - node0.getY());

        theDirection.normalize();

        double x = node1.x - (theDirection.data[0] * off);
        double y = node1.y - (theDirection.data[1] * off);
        Vector2 perp = new Vector2(theDirection.data[1],
            -theDirection.data[0]);
View Full Code Here


        double x = node1.x - (theDirection.data[0] * off);
        double y = node1.y - (theDirection.data[1] * off);
        Vector2 perp = new Vector2(theDirection.data[1],
            -theDirection.data[0]);

        perp.normalize();
        theDirection.scalarMult(arrowLength);
        perp.scalarMult(arrowWidth);

        // Create a polygon.

View Full Code Here

            Point2 p3 = new Point2(edge.to.getX(), edge.to.getY());
            Vector2 perp = CubicCurve.perpendicular(p0, p1, p2, p3,
                sprite.getX());
            double y = metrics.lengthToGu(sprite.getY(), sprite.getUnits());

            perp.normalize();
            perp.scalarMult(y);

            pos.x = CubicCurve.eval(p0.x, p1.x, p2.x, p3.x, sprite.getX())
                - perp.data[0];
            pos.y = CubicCurve.eval(p0.y, p1.y, p2.y, p3.y, sprite.getX())
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.