get Manhattan Distance - Java java.lang

Java examples for java.lang:Math Trigonometric Function

Description

get Manhattan Distance

Demo Code


//package com.java2s;

public class Main {
    public static float getManhattanDistance(float parPosX1,
            float parPosY1, float parPosX2, float parPosY2) {
        return (parPosX2 - parPosX1) + (parPosY2 - parPosY1);
    }// w  w w .  j a  v a2s .c om
}

Related Tutorials