quadratic blending function to be used in blendMin and blendMax - Java java.lang

Java examples for java.lang:Math Curve

Description

quadratic blending function to be used in blendMin and blendMax

Demo Code

/*****************************************************************************
 *                        Shapeways, Inc Copyright (c) 2011
 *                               Java Source
 *
 * This source is licensed under the GNU LGPL v2.1
 * Please read http://www.gnu.org/copyleft/lgpl.html for more information
 *
 * This software comes with the standard NO WARRANTY disclaimer for any
 * purpose. Use it at your own risk. If there's a problem you get to fix it.
 *
 ****************************************************************************/
import javax.vecmath.Vector3d;
import javax.vecmath.Vector4d;
import javax.vecmath.AxisAngle4d;
import javax.vecmath.Quat4d;
import javax.vecmath.Matrix3d;
import javax.vecmath.SingularMatrixException;
import static java.lang.Math.sqrt;
import static java.lang.Math.abs;
import static java.lang.Math.max;
import static abfab3d.core.Output.fmt;

public class Main{
    /**//from w ww .j a v  a2s. c  o  m
       quadratic blending function to be used in blendMin and blendMax
     */
    public static final double blendQuadric(double x) {
        return (1. - x) * (1. - x) * 0.25;
    }
}

Related Tutorials