complete Vertical Line from two Point - Android java.lang

Android examples for java.lang:Math Geometry

Description

complete Vertical Line from two Point

Demo Code


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

public class Main {
    public static Point completeVerticalLine(Point one, Point two) {
        Point three = null;//w w w  . j  a  va2s  .  c  o m
        if (one.x == two.x)
            three = new Point(one.x, getThirdValue(one.y, two.y));
        return three;
    }

    private static int getThirdValue(int one, int two) {
        if (one == 1 && two == 2)
            return 3;
        else if (one == 1 && two == 3)
            return 2;
        else
            return 1;
    }
}

Related Tutorials