Scales a point by the specified factor - Android Graphics

Android examples for Graphics:Path Point

Description

Scales a point by the specified factor

Demo Code


//package com.java2s;

import android.graphics.PointF;

public class Main {
    /**/*www  . j  a  v a2 s  .c  o m*/
     * Scales a point by the specified factor
     * @param p The point to be scaled
     * @param scale The scaling factor
     * @return The scaled point (i.e., s * p)
     */
    public static PointF scale(PointF p, float scale) {
        return new PointF(p.x * scale, p.y * scale);
    }
}

Related Tutorials