Added Vector.getMidpoint

This commit is contained in:
TomyLobo 2012-01-05 15:35:06 +01:00
parent 555758288b
commit a7530b7f89

View File

@ -708,4 +708,19 @@ public class Vector {
Math.max(v1.z, v2.z) Math.max(v1.z, v2.z)
); );
} }
/**
* Gets the midpoint of two vectors.
*
* @param v1
* @param v2
* @return maximum
*/
public static Vector getMidpoint(Vector v1, Vector v2) {
return new Vector(
(v1.x + v2.x) / 2,
(v1.y + v2.y) / 2,
(v1.z + v2.z) / 2
);
}
} }