MathUtils class

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

angle2CosSlope(double angle) double
输入角度值,return cos斜率
angle2SinSlope(double angle) double
输入角度值,return sin斜率
calculateSlope(Offset pre, Offset next) double
计算两个坐标的斜率值
calculateSlopeNotAbs(Offset pre, Offset next) double
计算两个坐标的斜率值
coordinateSwitch(int fixedRotationAngle, double dx, double dy) Offset
传入直角三角形三个顶点坐标和三角形内任意一个坐标点,然后计算得到该坐标点到斜边上的高 通过求大三角形的面积,减去坐标点(x, y)垂直于三角形另外两条边形成的2个三角形面积,再除以斜边得到斜边上的高 坐标系转换(支持 90, 180, -180, -90)
cosSlope2Angle(double cosSlope) double
输入cos斜率, return 角度值
distanceTo(Offset pre, Offset next) double
计算两点距离
getReverseXBySlope(double slope, Offset bOffset, double ay) Offset
斜率 = (bx - ax) / (by - ay) 逆推得到ax
getReverseYBySlope(double slope, Offset bOffset, double ax) Offset
斜率 = (bx - ax) / (by - ay) 逆推得到ay
getTriangularHeight(Offset rightAnglePoint, Offset other, Offset other2) double
传入直角三角形3个顶点,然后计算斜边为底的高度h
getTriangularHeight2(double hypotenuse, double angle) double
传入直角三角形斜边和其中一个夹角,然后计算斜边为底的高度h
insideOrOutsideOfLine(Offset pre, Offset center, Offset next) int
判断某个点是在在两个点连线的里边还是外边
insideOrOutsideOfLine2(Offset left, Offset right, Offset point, {required bool inRight}) int
判断某个点是在在两个点连线的里边还是外边2
retrace(num x) double
输入角度值,return 弧度值
sinSlope2Angle(double sinSlope) double
输入sin斜率, return 角度值
trace(num x) double
输入弧度值,return 角度值