diff --git a/src/xyz/soper/arty/util/ArtyMath.java b/src/xyz/soper/arty/util/ArtyMath.java index 3c37ee5..8c83435 100644 --- a/src/xyz/soper/arty/util/ArtyMath.java +++ b/src/xyz/soper/arty/util/ArtyMath.java @@ -30,6 +30,19 @@ public class ArtyMath { return eastVector.angle(vector); } + public static double calculateDirectionDOTPRODUCT(Vector vector){ + double x = vector.getX(); + double z = vector.getZ(); + double directionMagnitude = Math.sqrt((x*x)+(z*z)); + //dot product is always going to just be the x value + //since the z value for the east vector is 0. + return Math.acos(x/directionMagnitude); + } + + public static double calculateDirectionBASICTRIG(Vector vector){ + return Math.atan(vector.getZ()/vector.getX()); + } + /** * Uses the elevation and direction angles given to return a unit vector corresponding to the angles. * @param elevation Angle of elevation in radians