C# Class MyMaths

Datei anzeigen Open project: TomBBonin/UnityHelpers Class Usage Examples

Public Methods

Method Description
ABCAreAligned2D ( Vector2 pointA, Vector2 pointB, Vector2 pointC, float epsilon ) : bool
DoSegmentsIntersect ( Vector2 segOneA, Vector2 segOneB, Vector2 segTwoA, Vector2 segTwoB ) : bool
GetEuclideanDistance ( Vector2 pointA, Vector2 pointB ) : float
GetSegmentCenter ( Vector2 segA, Vector2 segB ) : Vector2
GetSegmentNormalTowardsPos ( Vector2 segA, Vector2 segB, Vector2 pos ) : Vector2
GetSquaredDistance ( Vector2 pointA, Vector2 pointB ) : float
IsPointCBetweenAB2D ( Vector2 pointA, Vector2 pointB, Vector2 pointC, float epsilon ) : bool
IsPowerOfTwo ( int x ) : bool
IsPowerOfTwo ( ulong x ) : bool

Method Details

ABCAreAligned2D() public static method

public static ABCAreAligned2D ( Vector2 pointA, Vector2 pointB, Vector2 pointC, float epsilon ) : bool
pointA Vector2
pointB Vector2
pointC Vector2
epsilon float
return bool

DoSegmentsIntersect() public static method

public static DoSegmentsIntersect ( Vector2 segOneA, Vector2 segOneB, Vector2 segTwoA, Vector2 segTwoB ) : bool
segOneA Vector2
segOneB Vector2
segTwoA Vector2
segTwoB Vector2
return bool

GetEuclideanDistance() public static method

public static GetEuclideanDistance ( Vector2 pointA, Vector2 pointB ) : float
pointA Vector2
pointB Vector2
return float

GetSegmentCenter() public static method

public static GetSegmentCenter ( Vector2 segA, Vector2 segB ) : Vector2
segA Vector2
segB Vector2
return Vector2

GetSegmentNormalTowardsPos() public static method

public static GetSegmentNormalTowardsPos ( Vector2 segA, Vector2 segB, Vector2 pos ) : Vector2
segA Vector2
segB Vector2
pos Vector2
return Vector2

GetSquaredDistance() public static method

public static GetSquaredDistance ( Vector2 pointA, Vector2 pointB ) : float
pointA Vector2
pointB Vector2
return float

IsPointCBetweenAB2D() public static method

public static IsPointCBetweenAB2D ( Vector2 pointA, Vector2 pointB, Vector2 pointC, float epsilon ) : bool
pointA Vector2
pointB Vector2
pointC Vector2
epsilon float
return bool

IsPowerOfTwo() public static method

public static IsPowerOfTwo ( int x ) : bool
x int
return bool

IsPowerOfTwo() public static method

public static IsPowerOfTwo ( ulong x ) : bool
x ulong
return bool