类 MIMath


  • public class MIMath
    extends java.lang.Object
    MeteoInfo Math class
    作者:
    Yaqiang Wang
    • 构造器概要

      构造器 
      构造器 说明
      MIMath()  
    • 方法概要

      所有方法 静态方法 具体方法 
      修饰符和类型 方法 说明
      static double[] arrayMinMax​(double[] values)
      Get min, max of an array
      static double[] arrayMinMax​(java.lang.Double[] values)
      Get min, max of an array
      static void arrayReverse​(double[] values)
      Array reverse
      static void arrayReverse​(java.lang.Object[] values)
      Array reverse
      static void arrayReverse​(PointD[] points)
      Array reverse
      static PointF calEllipseCoordByAngle​(double x0, double y0, double a, double b, double angle)
      Calculate ellipse coordinate by angle
      static double[] cartesianToPolar​(double x, double y)
      Convert cartesian to polar coordinate
      static boolean doubleEquals​(double a, double b)
      Determine if two double data equal
      static boolean doubleEquals_Abs​(double a, double b)
      Determine if two double data equal
      static PointF getCrossPoint​(PointF aP1, PointF aP2, PointF bP1, PointF bP2)
      Get cross point of two line segments
      static int getDecimalNum​(double aData)
      Get decimal number of a double data for ToString() format
      static int getDecimalNum_back​(double aData)
      Get decimal number of a double data for ToString() format
      static Extent getExtent​(java.util.List<? extends Shape> shapes)
      Get extent of the shapes
      static double[] getIntervalValues​(double min, double max)
      Create contour values by minimum and maximum values
      static java.util.List<java.lang.Object> getIntervalValues​(double min, double max, boolean isExtend)
      Create contour values by minimum and maximum values
      static double[] getIntervalValues​(double min, double max, double interval)
      Create values by interval
      static double[] getIntervalValues​(double min, double max, int n)
      Get interval values
      static double[] getIntervalValues_Log​(double min, double max)
      Create log interval values by minimum and maximum values
      static double[] getIntervalValues_Log_bak​(double min, double max)
      Create log interval values by minimum and maximum values
      static java.util.List<java.lang.Object> getIntervalValues1​(double min, double max)
      Create contour values by minimum and maximum values
      static Extent getLagerExtent​(Extent aET, Extent bET)
      Get maximum extent from two extent
      static int[] getMinMaxInt​(java.util.List S)
      Get mininum and maximum values
      static double[] getMinMaxValue​(double[] S, double unDef)
      Get mininum and maximum values
      static double[] getMinMaxValue​(java.util.List S)
      Get mininum and maximum values
      static double[] getMinMaxValue​(java.util.List<java.lang.Double> S, double unDef)
      Get mininum and maximum values
      static Extent getPointFsExtent​(java.util.List<PointF> PList)
      Get extent from PointF list
      static Extent getPointFsExtent​(PointF[] PList)
      Get extent from PointF array
      static Extent getPointsExtent​(java.util.List<? extends PointD> PList)
      Get extent from point list
      static Extent getSmallerExtent​(Extent aET, Extent bET)
      Get Minimum extent from two extent
      static double getValue​(double[] data, float idx)
      Get value from one dimension double array by index
      static java.lang.Boolean isExtentCross​(Extent aET, Extent bET)
      Determine if two extent cross each other
      static boolean isInclude​(java.awt.Rectangle aRect, java.awt.Rectangle bRect)
      Judge if a rectangle include another
      static boolean isNumeric​(java.lang.String strNumber)
      Determine if a string is digital
      static boolean isNumeric​(Field field)
      Determine if a field is numeric
      static float lonAdd​(float lon1, float delta)
      Add longitude
      static float lonDistance​(float lon1, float lon2)
      Longitude distance
      static boolean pointInExtent​(PointD aP, Extent aET)
      Determine if a point is in an Extent
      static boolean pointInExtent​(PointF aP, Extent aET)
      Determine if a point is in an Extent
      static boolean pointInRectangle​(java.awt.Point aP, java.awt.Rectangle aRect)
      Determine if a point is in a rectangel
      static boolean pointInRectangle​(PointD aP, java.awt.Rectangle aRect)
      Determine if a point is in a rectangel
      static boolean pointInRectangle​(PointF aP, java.awt.Rectangle aRect)
      Determine if a point is in a rectangel
      static double[] polarToCartesian​(double B, double r)
      Convert poar to cartesian coordinate
      static Extent shiftExtentLon​(Extent aET, double lonShift)
      Shift extent with longitude
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • MIMath

        public MIMath()
    • 方法详细资料

      • doubleEquals

        public static boolean doubleEquals​(double a,
                                           double b)
        Determine if two double data equal
        参数:
        a - double a
        b - double b
        返回:
        boolean
      • doubleEquals_Abs

        public static boolean doubleEquals_Abs​(double a,
                                               double b)
        Determine if two double data equal
        参数:
        a - double a
        b - double b
        返回:
        boolean
      • getMinMaxValue

        public static double[] getMinMaxValue​(double[] S,
                                              double unDef)
        Get mininum and maximum values
        参数:
        S - Data array
        unDef - Undefined data
        返回:
        Minimum and Maximum data array
      • getMinMaxValue

        public static double[] getMinMaxValue​(java.util.List<java.lang.Double> S,
                                              double unDef)
        Get mininum and maximum values
        参数:
        S - Data list
        unDef - Undefined data
        返回:
        Minimum and Maximum data array
      • getMinMaxValue

        public static double[] getMinMaxValue​(java.util.List S)
        Get mininum and maximum values
        参数:
        S - Data list
        返回:
        Minimum and Maximum data array
      • getMinMaxInt

        public static int[] getMinMaxInt​(java.util.List S)
        Get mininum and maximum values
        参数:
        S - Data list
        返回:
        Minimum and Maximum data array
      • isNumeric

        public static boolean isNumeric​(java.lang.String strNumber)
        Determine if a string is digital
        参数:
        strNumber - the string
        返回:
        Boolean
      • isNumeric

        public static boolean isNumeric​(Field field)
        Determine if a field is numeric
        参数:
        field - The field
        返回:
        Boolean
      • getPointsExtent

        public static Extent getPointsExtent​(java.util.List<? extends PointD> PList)
        Get extent from point list
        参数:
        PList - point list
        返回:
        extent
      • getPointFsExtent

        public static Extent getPointFsExtent​(PointF[] PList)
        Get extent from PointF array
        参数:
        PList - PointF array
        返回:
        The extent
      • getPointFsExtent

        public static Extent getPointFsExtent​(java.util.List<PointF> PList)
        Get extent from PointF list
        参数:
        PList - PointF list
        返回:
        The extent
      • arrayReverse

        public static void arrayReverse​(PointD[] points)
        Array reverse
        参数:
        points - PointD array
      • arrayReverse

        public static void arrayReverse​(double[] values)
        Array reverse
        参数:
        values - Double array
      • arrayReverse

        public static void arrayReverse​(java.lang.Object[] values)
        Array reverse
        参数:
        values - Object array
      • arrayMinMax

        public static double[] arrayMinMax​(double[] values)
        Get min, max of an array
        参数:
        values - array
        返回:
        Min, max
      • arrayMinMax

        public static double[] arrayMinMax​(java.lang.Double[] values)
        Get min, max of an array
        参数:
        values - array
        返回:
        Min, max
      • getCrossPoint

        public static PointF getCrossPoint​(PointF aP1,
                                           PointF aP2,
                                           PointF bP1,
                                           PointF bP2)
        Get cross point of two line segments
        参数:
        aP1 - point 1 of line a
        aP2 - point 2 of line a
        bP1 - point 1 of line b
        bP2 - point 2 of line b
        返回:
        cross point
      • shiftExtentLon

        public static Extent shiftExtentLon​(Extent aET,
                                            double lonShift)
        Shift extent with longitude
        参数:
        aET - Input extent
        lonShift - Longitude shift
        返回:
        Output extent
      • getLagerExtent

        public static Extent getLagerExtent​(Extent aET,
                                            Extent bET)
        Get maximum extent from two extent
        参数:
        aET - Extent a
        bET - Extent b
        返回:
        Maximum extent
      • getSmallerExtent

        public static Extent getSmallerExtent​(Extent aET,
                                              Extent bET)
        Get Minimum extent from two extent
        参数:
        aET - Extent a
        bET - Extent b
        返回:
        Minimum extent
      • getExtent

        public static Extent getExtent​(java.util.List<? extends Shape> shapes)
        Get extent of the shapes
        参数:
        shapes -
        返回:
        Extent
      • isExtentCross

        public static java.lang.Boolean isExtentCross​(Extent aET,
                                                      Extent bET)
        Determine if two extent cross each other
        参数:
        aET - Extent
        bET - Extent
        返回:
        Boolean
      • pointInExtent

        public static boolean pointInExtent​(PointD aP,
                                            Extent aET)
        Determine if a point is in an Extent
        参数:
        aP - The point
        aET - The extent
        返回:
        Boolean
      • pointInExtent

        public static boolean pointInExtent​(PointF aP,
                                            Extent aET)
        Determine if a point is in an Extent
        参数:
        aP - The point
        aET - The extent
        返回:
        Boolean
      • pointInRectangle

        public static boolean pointInRectangle​(PointF aP,
                                               java.awt.Rectangle aRect)
        Determine if a point is in a rectangel
        参数:
        aP - The point
        aRect - The rectangel
        返回:
        Boolean
      • pointInRectangle

        public static boolean pointInRectangle​(java.awt.Point aP,
                                               java.awt.Rectangle aRect)
        Determine if a point is in a rectangel
        参数:
        aP - The point
        aRect - The rectangel
        返回:
        Boolean
      • pointInRectangle

        public static boolean pointInRectangle​(PointD aP,
                                               java.awt.Rectangle aRect)
        Determine if a point is in a rectangel
        参数:
        aP - The point
        aRect - The rectangel
        返回:
        Boolean
      • isInclude

        public static boolean isInclude​(java.awt.Rectangle aRect,
                                        java.awt.Rectangle bRect)
        Judge if a rectangle include another
        参数:
        aRect - a rectangle
        bRect - b rectangle
        返回:
        Boolean
      • calEllipseCoordByAngle

        public static PointF calEllipseCoordByAngle​(double x0,
                                                    double y0,
                                                    double a,
                                                    double b,
                                                    double angle)
        Calculate ellipse coordinate by angle
        参数:
        x0 - Center x
        y0 - Center y
        a - Major semi axis
        b - Minor semi axis
        angle - Angle
        返回:
        Coordinate
      • getDecimalNum

        public static int getDecimalNum​(double aData)
        Get decimal number of a double data for ToString() format
        参数:
        aData - Data
        返回:
        Decimal number
      • getDecimalNum_back

        public static int getDecimalNum_back​(double aData)
        Get decimal number of a double data for ToString() format
        参数:
        aData - Data
        返回:
        Decimal number
      • lonDistance

        public static float lonDistance​(float lon1,
                                        float lon2)
        Longitude distance
        参数:
        lon1 - Longitude 1
        lon2 - Longitude 2
        返回:
        Longitude distance
      • lonAdd

        public static float lonAdd​(float lon1,
                                   float delta)
        Add longitude
        参数:
        lon1 - Longitude 1
        delta - Delta
        返回:
        Longitude
      • getValue

        public static double getValue​(double[] data,
                                      float idx)
        Get value from one dimension double array by index
        参数:
        data - Data
        idx - Index
        返回:
        Value
      • getIntervalValues

        public static double[] getIntervalValues​(double min,
                                                 double max,
                                                 double interval)
        Create values by interval
        参数:
        min - Miminum value
        max - Maximum value
        interval - Interval value
        返回:
        Value array
      • getIntervalValues

        public static double[] getIntervalValues​(double min,
                                                 double max,
                                                 int n)
        Get interval values
        参数:
        min - Minimum value
        max - Maximum value
        n - Level number
        返回:
        Values
      • getIntervalValues

        public static double[] getIntervalValues​(double min,
                                                 double max)
        Create contour values by minimum and maximum values
        参数:
        min - Minimum value
        max - Maximum value
        返回:
        Contour values
      • getIntervalValues1

        public static java.util.List<java.lang.Object> getIntervalValues1​(double min,
                                                                          double max)
        Create contour values by minimum and maximum values
        参数:
        min - Minimum value
        max - Maximum value
        返回:
        Contour values
      • getIntervalValues

        public static java.util.List<java.lang.Object> getIntervalValues​(double min,
                                                                         double max,
                                                                         boolean isExtend)
        Create contour values by minimum and maximum values
        参数:
        min - Minimum value
        max - Maximum value
        isExtend - If extend values
        返回:
        Contour values
      • getIntervalValues_Log

        public static double[] getIntervalValues_Log​(double min,
                                                     double max)
        Create log interval values by minimum and maximum values
        参数:
        min - Minimum value
        max - Maximum value
        返回:
        Interval values
      • getIntervalValues_Log_bak

        public static double[] getIntervalValues_Log_bak​(double min,
                                                         double max)
        Create log interval values by minimum and maximum values
        参数:
        min - Minimum value
        max - Maximum value
        返回:
        Interval values
      • cartesianToPolar

        public static double[] cartesianToPolar​(double x,
                                                double y)
        Convert cartesian to polar coordinate
        参数:
        x - X
        y - Y
        返回:
        Angle and radius
      • polarToCartesian

        public static double[] polarToCartesian​(double B,
                                                double r)
        Convert poar to cartesian coordinate
        参数:
        r - Radius
        B - Angle in radians
        返回:
        X and y in cartesian coordinate