类 MIMath
- java.lang.Object
-
- org.meteoinfo.common.MIMath
-
public class MIMath extends java.lang.ObjectMeteoInfo Math class- 作者:
- Yaqiang Wang
-
-
构造器概要
构造器 构造器 说明 MIMath()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static double[]arrayMinMax(double[] values)Get min, max of an arraystatic double[]arrayMinMax(java.lang.Double[] values)Get min, max of an arraystatic voidarrayReverse(double[] values)Array reversestatic voidarrayReverse(java.lang.Object[] values)Array reversestatic voidarrayReverse(PointD[] points)Array reversestatic PointFcalEllipseCoordByAngle(double x0, double y0, double a, double b, double angle)Calculate ellipse coordinate by anglestatic double[]cartesianToPolar(double x, double y)Convert cartesian to polar coordinatestatic booleandoubleEquals(double a, double b)Determine if two double data equalstatic booleandoubleEquals_Abs(double a, double b)Determine if two double data equalstatic PointFgetCrossPoint(PointF aP1, PointF aP2, PointF bP1, PointF bP2)Get cross point of two line segmentsstatic intgetDecimalNum(double aData)Get decimal number of a double data for ToString() formatstatic intgetDecimalNum_back(double aData)Get decimal number of a double data for ToString() formatstatic double[]getDSFromUV(double U, double V)Get wind direction/speed from U/Vstatic double[]getEndPoint(double x, double y, double angle, double len)Get end point by start point, angle and lengthstatic double[]getIntervalValues(double min, double max)Create contour values by minimum and maximum valuesstatic java.util.List<java.lang.Object>getIntervalValues(double min, double max, boolean isExtend)Create contour values by minimum and maximum valuesstatic double[]getIntervalValues(double min, double max, double interval)Create values by intervalstatic double[]getIntervalValues(double min, double max, double interval, int n)Create values by intervalstatic double[]getIntervalValues(double min, double max, int n)Get interval valuesstatic double[]getIntervalValues_Log(double min, double max)Create log interval values by minimum and maximum valuesstatic double[]getIntervalValues_Log_bak(double min, double max)Create log interval values by minimum and maximum valuesstatic java.util.List<java.lang.Object>getIntervalValues1(double min, double max)Create contour values by minimum and maximum valuesstatic ExtentgetLagerExtent(Extent aET, Extent bET)Get maximum extent from two extentstatic int[]getMinMaxInt(java.util.List S)Get mininum and maximum valuesstatic double[]getMinMaxValue(double[] S, double unDef)Get mininum and maximum valuesstatic double[]getMinMaxValue(java.util.List S)Get mininum and maximum valuesstatic double[]getMinMaxValue(java.util.List<java.lang.Double> S, double unDef)Get mininum and maximum valuesstatic ExtentgetPointFsExtent(java.util.List<PointF> PList)Get extent from PointF liststatic ExtentgetPointFsExtent(PointF[] PList)Get extent from PointF arraystatic ExtentgetSmallerExtent(Extent aET, Extent bET)Get Minimum extent from two extentstatic double[]getUVFromDS(double windDir, double windSpeed)Get wind U/V from wind direction/speedstatic doublegetValue(double[] data, float idx)Get value from one dimension double array by indexstatic java.lang.BooleanisExtentCross(Extent aET, Extent bET)Determine if two extent cross each otherstatic booleanisInclude(java.awt.Rectangle aRect, java.awt.Rectangle bRect)Judge if a rectangle include anotherstatic booleanisNumeric(java.lang.String strNumber)Determine if a string is digitalstatic floatlonAdd(float lon1, float delta)Add longitudestatic floatlonDistance(float lon1, float lon2)Longitude distancestatic doublemean(java.util.List<java.lang.Double> aDataList)Mean funtionstatic booleanpointInExtent(PointD aP, Extent aET)Determine if a point is in an Extentstatic booleanpointInExtent(PointF aP, Extent aET)Determine if a point is in an Extentstatic booleanpointInRectangle(java.awt.Point aP, java.awt.Rectangle aRect)Determine if a point is in a rectangelstatic booleanpointInRectangle(PointD aP, java.awt.Rectangle aRect)Determine if a point is in a rectangelstatic booleanpointInRectangle(PointF aP, java.awt.Rectangle aRect)Determine if a point is in a rectangelstatic double[]polarToCartesian(double B, double r)Convert poar to cartesian coordinatestatic ExtentshiftExtentLon(Extent aET, double lonShift)Shift extent with longitude
-
-
-
方法详细资料
-
doubleEquals
public static boolean doubleEquals(double a, double b)Determine if two double data equal- 参数:
a- double ab- double b- 返回:
- boolean
-
doubleEquals_Abs
public static boolean doubleEquals_Abs(double a, double b)Determine if two double data equal- 参数:
a- double ab- double b- 返回:
- boolean
-
getMinMaxValue
public static double[] getMinMaxValue(double[] S, double unDef)Get mininum and maximum values- 参数:
S- Data arrayunDef- 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 listunDef- 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
-
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
-
mean
public static double mean(java.util.List<java.lang.Double> aDataList)
Mean funtion- 参数:
aDataList- The data list- 返回:
- Mean
-
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 aaP2- point 2 of line abP1- point 1 of line bbP2- point 2 of line b- 返回:
- cross point
-
shiftExtentLon
public static Extent shiftExtentLon(Extent aET, double lonShift)
Shift extent with longitude- 参数:
aET- Input extentlonShift- Longitude shift- 返回:
- Output extent
-
getLagerExtent
public static Extent getLagerExtent(Extent aET, Extent bET)
Get maximum extent from two extent- 参数:
aET- Extent abET- Extent b- 返回:
- Maximum extent
-
getSmallerExtent
public static Extent getSmallerExtent(Extent aET, Extent bET)
Get Minimum extent from two extent- 参数:
aET- Extent abET- Extent b- 返回:
- Minimum extent
-
isExtentCross
public static java.lang.Boolean isExtentCross(Extent aET, Extent bET)
Determine if two extent cross each other- 参数:
aET- ExtentbET- Extent- 返回:
- Boolean
-
pointInExtent
public static boolean pointInExtent(PointD aP, Extent aET)
Determine if a point is in an Extent- 参数:
aP- The pointaET- The extent- 返回:
- Boolean
-
pointInExtent
public static boolean pointInExtent(PointF aP, Extent aET)
Determine if a point is in an Extent- 参数:
aP- The pointaET- The extent- 返回:
- Boolean
-
pointInRectangle
public static boolean pointInRectangle(PointF aP, java.awt.Rectangle aRect)
Determine if a point is in a rectangel- 参数:
aP- The pointaRect- 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 pointaRect- The rectangel- 返回:
- Boolean
-
pointInRectangle
public static boolean pointInRectangle(PointD aP, java.awt.Rectangle aRect)
Determine if a point is in a rectangel- 参数:
aP- The pointaRect- The rectangel- 返回:
- Boolean
-
isInclude
public static boolean isInclude(java.awt.Rectangle aRect, java.awt.Rectangle bRect)Judge if a rectangle include another- 参数:
aRect- a rectanglebRect- 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 xy0- Center ya- Major semi axisb- Minor semi axisangle- 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 1lon2- Longitude 2- 返回:
- Longitude distance
-
lonAdd
public static float lonAdd(float lon1, float delta)Add longitude- 参数:
lon1- Longitude 1delta- Delta- 返回:
- Longitude
-
getValue
public static double getValue(double[] data, float idx)Get value from one dimension double array by index- 参数:
data- Dataidx- Index- 返回:
- Value
-
getIntervalValues
public static double[] getIntervalValues(double min, double max, double interval)Create values by interval- 参数:
min- Miminum valuemax- Maximum valueinterval- Interval value- 返回:
- Value array
-
getIntervalValues
public static double[] getIntervalValues(double min, double max, double interval, int n)Create values by interval- 参数:
min- Miminum valuemax- Maximum valueinterval- Interval valuen- Value number- 返回:
- Value array
-
getIntervalValues
public static double[] getIntervalValues(double min, double max, int n)Get interval values- 参数:
min- Minimum valuemax- Maximum valuen- Level number- 返回:
- Values
-
getIntervalValues
public static double[] getIntervalValues(double min, double max)Create contour values by minimum and maximum values- 参数:
min- Minimum valuemax- 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 valuemax- 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 valuemax- Maximum valueisExtend- 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 valuemax- 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 valuemax- Maximum value- 返回:
- Interval values
-
cartesianToPolar
public static double[] cartesianToPolar(double x, double y)Convert cartesian to polar coordinate- 参数:
x- Xy- Y- 返回:
- Angle and radius
-
polarToCartesian
public static double[] polarToCartesian(double B, double r)Convert poar to cartesian coordinate- 参数:
r- RadiusB- Angle in radians- 返回:
- X and y in cartesian coordinate
-
getDSFromUV
public static double[] getDSFromUV(double U, double V)Get wind direction/speed from U/V- 参数:
U- The U valueV- The V value- 返回:
- Wind direction/speed array
-
getUVFromDS
public static double[] getUVFromDS(double windDir, double windSpeed)Get wind U/V from wind direction/speed- 参数:
windDir- The wind directionwindSpeed- The wind speed- 返回:
- Wind U/V
-
getEndPoint
public static double[] getEndPoint(double x, double y, double angle, double len)Get end point by start point, angle and length- 参数:
x- Start point xy- Start point yangle- Anglelen- Length- 返回:
- End point x/y values;
-
-