Calculate Bezier Point For Quadratic - Android Graphics

Android examples for Graphics:Path Point

Description

Calculate Bezier Point For Quadratic

Demo Code


//package com.java2s;
import android.graphics.PointF;

public class Main {

    public static PointF CalculateBezierPointForQuadratic(float t,
            PointF p0, PointF p1, PointF p2) {
        PointF point = new PointF();
        float temp = 1 - t;
        point.x = temp * temp * p0.x + 2 * t * temp * p1.x + t * t * p2.x;
        point.y = temp * temp * p0.y + 2 * t * temp * p1.y + t * t * p2.y;
        return point;
    }//from   ww w.  ja va 2s.  c  o  m
}

Related Tutorials