Package javax.vecmath

Examples of javax.vecmath.Point3d.interpolate()


    public static Point3d getBarycentre(Point3d startPoint, Point3d endPoint, double distance) {
        double maxDistance = startPoint.distance(endPoint);
        double distanceToUse = computeDistanceToUse(maxDistance, distance);
        double ratio = distanceToUse / maxDistance;
        Point3d result = new Point3d();
        result.interpolate(startPoint, endPoint, ratio);
        return result;
    }

    /**
     * Bounds the given distance between 0 and maxDistance
View Full Code Here


            saveAttachPoint2 = attachPoint;
        }

        // once this couple is found, place the new leaf approximately in the middle +/-20%
        Point3d newLeafAttachPoint = new Point3d();
        newLeafAttachPoint.interpolate(saveAttachPoint1, saveAttachPoint2, 0.5 + Randomizer.random1());
        return newLeafAttachPoint;
    }

    private void collectFreeEnergyFromLeaves() {
        BigDecimal freeEnergyCollectedFromLeaf = new BigDecimal(0);
View Full Code Here

            saveAttachPoint2 = attachPoint;
        }

        // once this couple is found, place the new leaf approximately in the middle +/-20%
        Point3d newLeafAttachPoint = new Point3d();
        newLeafAttachPoint.interpolate(saveAttachPoint1, saveAttachPoint2, 0.5 + Randomizer.random1());
        return newLeafAttachPoint;
    }

    @Override
    public BigDecimal getEnergy() {
View Full Code Here

            saveAttachPoint1 = previousAttachPoint;
            saveAttachPoint2 = attachPoint;
        }
        previousAttachPoint = attachPoint;
        Point3d newLeafAttachPoint = new Point3d();
        newLeafAttachPoint.interpolate(saveAttachPoint1, saveAttachPoint2, 0.5 + Randomizer.random1());
        return newLeafAttachPoint;
    }

    private void collectFreeEnergyFromLeaves() {
        BigDecimal freeEnergyCollectedFromLeaf = new BigDecimal(0);
View Full Code Here

    public static Point3d getBarycentre(Point3d startPoint, Point3d endPoint, double distance) {
        double maxDistance = startPoint.distance(endPoint);
        double distanceToUse = computeDistanceToUse(maxDistance, distance);
        double ratio = distanceToUse / maxDistance;
        Point3d result = new Point3d();
        result.interpolate(startPoint, endPoint, ratio);
        return result;
    }

    /**
     * Bounds the given distance between 0 and maxDistance
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.