C# Class MathUtil, UnityFramework

Afficher le fichier Open project: meta-42/uEasyKit Class Usage Examples

Méthodes publiques

Méthode Description
AngleBetweenLines ( Vector2 start1, Vector2 end1, Vector2 start2, Vector2 end2 ) : double

两条线之间的角度

AngleOfLine ( Vector2 start, Vector2 end ) : double

获取一条线以起始点为圆心的顺时针旋转角度

CubicBezierEvaluate ( float p0, float p1, float p2, float p3, float t ) : float
DistanceSqr ( Vector2 one, Vector2 two ) : float

两点距离的平方, [用这个比较长度效率高]

GeneralBezierEvaluate ( Vector3 points, float t ) : Vector3
LineIntersectCircle ( Vector2 start, Vector2 end, Vector2 circlePoint, float circleRadius ) : bool

判断直线和圆是否相交.

LineIntersectRect ( Vector2 start, Vector2 end, Rect rect ) : bool

判断直线是否和矩形相交

LinearBezierEvaluate ( Vector3 p0, Vector3 p1, float t ) : Vector3
LinearBezierEvaluate ( float p0, float p1, float t ) : float
PointToLineDistanceSqr ( Vector2 point, Vector2 start, Vector2 end ) : float

计算点到直线的距离的平方.

PointWithAngle ( Vector2 point, float distance, float angle ) : Vector2

从原点向一个给定角度移动给定的距离

QuadBezierEvaluate ( float p0, float p1, float p2, float t ) : float
RadianToDegree ( double radian ) : double

弧度转角度

lineIntersectLine ( Vector2 start1, Vector2 end1, Vector2 start2, Vector2 end2 ) : bool

判断两条直线是否相交.

Method Details

AngleBetweenLines() public static méthode

两条线之间的角度
public static AngleBetweenLines ( Vector2 start1, Vector2 end1, Vector2 start2, Vector2 end2 ) : double
start1 Vector2
end1 Vector2
start2 Vector2
end2 Vector2
Résultat double

AngleOfLine() public static méthode

获取一条线以起始点为圆心的顺时针旋转角度
public static AngleOfLine ( Vector2 start, Vector2 end ) : double
start Vector2
end Vector2
Résultat double

CubicBezierEvaluate() public static méthode

public static CubicBezierEvaluate ( float p0, float p1, float p2, float p3, float t ) : float
p0 float
p1 float
p2 float
p3 float
t float
Résultat float

DistanceSqr() public static méthode

两点距离的平方, [用这个比较长度效率高]
public static DistanceSqr ( Vector2 one, Vector2 two ) : float
one Vector2
two Vector2
Résultat float

GeneralBezierEvaluate() public static méthode

public static GeneralBezierEvaluate ( Vector3 points, float t ) : Vector3
points Vector3
t float
Résultat Vector3

LineIntersectCircle() public static méthode

判断直线和圆是否相交.
public static LineIntersectCircle ( Vector2 start, Vector2 end, Vector2 circlePoint, float circleRadius ) : bool
start Vector2
end Vector2
circlePoint Vector2
circleRadius float
Résultat bool

LineIntersectRect() public static méthode

判断直线是否和矩形相交
public static LineIntersectRect ( Vector2 start, Vector2 end, Rect rect ) : bool
start Vector2
end Vector2
rect Rect
Résultat bool

LinearBezierEvaluate() public static méthode

public static LinearBezierEvaluate ( Vector3 p0, Vector3 p1, float t ) : Vector3
p0 Vector3
p1 Vector3
t float
Résultat Vector3

LinearBezierEvaluate() public static méthode

public static LinearBezierEvaluate ( float p0, float p1, float t ) : float
p0 float
p1 float
t float
Résultat float

PointToLineDistanceSqr() public static méthode

计算点到直线的距离的平方.
public static PointToLineDistanceSqr ( Vector2 point, Vector2 start, Vector2 end ) : float
point Vector2
start Vector2
end Vector2
Résultat float

PointWithAngle() public static méthode

从原点向一个给定角度移动给定的距离
public static PointWithAngle ( Vector2 point, float distance, float angle ) : Vector2
point Vector2
distance float
angle float
Résultat Vector2

QuadBezierEvaluate() public static méthode

public static QuadBezierEvaluate ( float p0, float p1, float p2, float t ) : float
p0 float
p1 float
p2 float
t float
Résultat float

RadianToDegree() public static méthode

弧度转角度
public static RadianToDegree ( double radian ) : double
radian double
Résultat double

lineIntersectLine() public static méthode

判断两条直线是否相交.
public static lineIntersectLine ( Vector2 start1, Vector2 end1, Vector2 start2, Vector2 end2 ) : bool
start1 Vector2
end1 Vector2
start2 Vector2
end2 Vector2
Résultat bool