Documentation of 'com.mhuss.AstroLib.MathOps' Java class
MathOps
com.mhuss.AstroLib

Class MathOps



  • public class MathOps
    extends java.lang.Object
    MathOps contains some useful trig, vector and matrix operations.

    Based on C code by Bill Gray (www.projectpluto.com)

    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int VECTOR_SIZE 
    • Constructor Summary

      Constructors 
      Constructor and Description
      MathOps() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static double acose(double arg)
      Calculates the arc cosine, but limits the input to the range ( -1.0 < rad < +1.0 ).
      static double asine(double arg)
      Calculates the arc sine, but limits the input to the range ( -1.0 < rad < +1.0 ).
      static void cartesianToPolar(double[] cartVect, double[] polarCoord) 
      static void polarToCartesian(double[] vectC, double[] vectP)
      Convert polar coordinates with radius to Cartesian coordinates added by w.
      static void polarToCartesian(double[] vect, double lon, double lat, double radius)
      Convert polar coordinates with radius to Cartesian coordinates added by w.
      static void rotateVector(double[] v, double angle, int axis)
      Rotate a vector along the specified axis.
      static void setIdentityMatrix(double[] matrix)
      Initializes a matrix to base (identity) values.
      • Methods inherited from class java.lang.Object

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

      • MathOps

        public MathOps()
    • Method Detail

      • acose

        public static double acose(double arg)
        Calculates the arc cosine, but limits the input to the range ( -1.0 < rad < +1.0 ).
        This avoids overflow errors. If the input is <= -1.0 radians, Math.PI is returned. If the input is >= 1.0 radians, 0 is returned.
        Parameters:
        arg - The angle in radians
        Returns:
        The arc cosine, limited to the range 0 to Pi.
      • asine

        public static double asine(double arg)
        Calculates the arc sine, but limits the input to the range ( -1.0 < rad < +1.0 ).
        This avoids overflow errors. If the input is less than -1 (radian), -PI/2 is returned. If the input is greater than 1 (radian), +PI/2 is returned.
        Parameters:
        arg - The angle in radians
        Returns:
        The arc sine, limited to the range -Pi/2 0 to Pi/2.
      • setIdentityMatrix

        public static void setIdentityMatrix(double[] matrix)
        Initializes a matrix to base (identity) values. The matrix is set as follows: [1][0][0] [0][1][0] [0][0][1]
        Parameters:
        matrix - The matrix to initialize
      • rotateVector

        public static void rotateVector(double[] v,
                                        double angle,
                                        int axis)
        Rotate a vector along the specified axis.
        Parameters:
        v - The vector to rotate
        angle - The angle to use
        axis - The axis along which to rotate
      • polarToCartesian

        public static void polarToCartesian(double[] vect,
                                            double lon,
                                            double lat,
                                            double radius)
        Convert polar coordinates with radius to Cartesian coordinates added by w. Strickling
        Parameters:
        vect - Vector to hold the Cartesian coordinates
        lon - Polar longitude
        lat - Polar latitude
      • polarToCartesian

        public static void polarToCartesian(double[] vectC,
                                            double[] vectP)
        Convert polar coordinates with radius to Cartesian coordinates added by w. Strickling
        Parameters:
        vectC - Vector to hold the Cartesian coordinates
        vectP - Vector to hold the Polar coordinates
      • cartesianToPolar

        public static void cartesianToPolar(double[] cartVect,
                                            double[] polarCoord)

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.