From a5a761a126827040ed10a8004f925894cfae73e9 Mon Sep 17 00:00:00 2001 From: TomyLobo Date: Mon, 5 Dec 2011 23:17:13 +0100 Subject: [PATCH] Added Vector.dot(Vector). --- src/main/java/com/sk89q/worldedit/Vector.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/com/sk89q/worldedit/Vector.java b/src/main/java/com/sk89q/worldedit/Vector.java index 45e28c70d..79a030ef5 100644 --- a/src/main/java/com/sk89q/worldedit/Vector.java +++ b/src/main/java/com/sk89q/worldedit/Vector.java @@ -612,6 +612,16 @@ public class Vector { return new BlockVector(this); } + /** + * Gets the dot product of this and another vector. + * + * @param other + * @return the dot product of this and the other vector + */ + public double dot(Vector other) { + return x * other.x + y * other.y + z * other.z; + } + /** * Gets the minimum components of two vectors. *