Class OpVect


  • public class OpVect
    extends java.lang.Object
    Class OpVect offers a list of static methods that deal with numeric vectors;
    it allows the user to read vectors from the keyboard, and to calculate the
    dot, cross and mixed product, as well as the modulus of a vector and the distance
    between two points.
    • Constructor Summary

      Constructors 
      Constructor Description
      OpVect()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static double[] crossProduct​(double[] a, double[] b)  
      static double distance​(double[] a, double[] b)  
      static double dotProduct​(double[] a, double[] b)  
      static java.lang.String doubleVectorAsString​(double[] v)  
      static double mixedProduct​(double[] a, double[] b, double[] c)  
      static double modulus​(double[] a)  
      static double modulus2​(double[] a)  
      static double[] readVectorD​(int numberOfElements)  
      static float[] readVectorF​(int numberOfElements)  
      static int[] readVectorI​(int numberOfElements)  
      static java.lang.String vToS​(double[] v)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OpVect

        public OpVect()
    • Method Detail

      • readVectorD

        public static double[] readVectorD​(int numberOfElements)
                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • readVectorF

        public static float[] readVectorF​(int numberOfElements)
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • readVectorI

        public static int[] readVectorI​(int numberOfElements)
                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • dotProduct

        public static double dotProduct​(double[] a,
                                        double[] b)
                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • crossProduct

        public static double[] crossProduct​(double[] a,
                                            double[] b)
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • mixedProduct

        public static double mixedProduct​(double[] a,
                                          double[] b,
                                          double[] c)
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • modulus

        public static double modulus​(double[] a)
      • modulus2

        public static double modulus2​(double[] a)
      • distance

        public static double distance​(double[] a,
                                      double[] b)
      • doubleVectorAsString

        public static java.lang.String doubleVectorAsString​(double[] v)
      • vToS

        public static java.lang.String vToS​(double[] v)