Class Vector2Ex
Inheritance
System.Object
Vector2Ex
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: cs.temp.dll.dll
Syntax
public static class Vector2Ex
Methods
Abs(Vector2)
new Vector2(Mathf.Abs(self.x), Mathf.Abs(self.y))
Declaration
public static Vector2 Abs(this Vector2 self)
Parameters
Type |
Name |
Description |
Vector2 |
self |
|
Returns
Angle360(Vector2, Vector2)
Vector2.Angleの360°版. fromをtoに回転させるために必要か角度を返す(-180 ~ 180)(反時計回りが正)
Declaration
public static float Angle360(Vector2 from, Vector2 to)
Parameters
Type |
Name |
Description |
Vector2 |
from |
|
Vector2 |
to |
|
Returns
Type |
Description |
System.Single |
|
Ave(Vector2)
Declaration
public static float Ave(this Vector2 self)
Parameters
Type |
Name |
Description |
Vector2 |
self |
|
Returns
Type |
Description |
System.Single |
|
CeilToInt(Vector2)
各成分に対してCeilToIntを適用してVector2Int型で返す
Declaration
public static Vector2Int CeilToInt(this Vector2 self)
Parameters
Type |
Name |
Description |
Vector2 |
self |
|
Returns
Type |
Description |
Vector2Int |
|
Centroid(IEnumerable<Vector2>)
Declaration
public static Vector2 Centroid(IEnumerable<Vector2> points)
Parameters
Type |
Name |
Description |
IEnumerable<Vector2> |
points |
|
Returns
Clamp(Vector2, Single, Single)
Declaration
public static Vector2 Clamp(this Vector2 x, float min, float max)
Parameters
Type |
Name |
Description |
Vector2 |
x |
|
System.Single |
min |
|
System.Single |
max |
|
Returns
Clamp(Vector2, Vector2, Vector2)
Declaration
public static Vector2 Clamp(this Vector2 x, Vector2 min, Vector2 max)
Parameters
Type |
Name |
Description |
Vector2 |
x |
|
Vector2 |
min |
|
Vector2 |
max |
|
Returns
Cos(Vector2)
Declaration
public static float Cos(this Vector2 self)
Parameters
Type |
Name |
Description |
Vector2 |
self |
|
Returns
Type |
Description |
System.Single |
|
Cross(Vector2, Vector2)
Vector2の外積. ret = a.x * b.y - a.y * b.x
Declaration
public static float Cross(Vector2 a, Vector2 b)
Parameters
Type |
Name |
Description |
Vector2 |
a |
|
Vector2 |
b |
|
Returns
Type |
Description |
System.Single |
|
Deg2Vector(Single)
角度からVector2を生成. return new Vector2(Cosθ, Sinθ)を返す
Declaration
public static Vector2 Deg2Vector(float degree)
Parameters
Type |
Name |
Description |
System.Single |
degree |
|
Returns
FloorToInt(Vector2)
各成分に対してFloorToIntを適用してVector2Int型で返す
Declaration
public static Vector2Int FloorToInt(this Vector2 self)
Parameters
Type |
Name |
Description |
Vector2 |
self |
|
Returns
Type |
Description |
Vector2Int |
|
IsNaNOrInfinity(Vector2)
Declaration
public static bool IsNaNOrInfinity(this Vector2 self)
Parameters
Type |
Name |
Description |
Vector2 |
self |
|
Returns
Type |
Description |
System.Boolean |
|
IsNaNOrInfinity(Vector3)
Declaration
public static bool IsNaNOrInfinity(this Vector3 self)
Parameters
Type |
Name |
Description |
Vector3 |
self |
|
Returns
Type |
Description |
System.Boolean |
|
Max(Vector2)
Mathf.Min(self.x, self.y)
Declaration
public static float Max(this Vector2 self)
Parameters
Type |
Name |
Description |
Vector2 |
self |
|
Returns
Type |
Description |
System.Single |
|
Min(Vector2)
Mathf.Min(self.x, self.y)
Declaration
public static float Min(this Vector2 self)
Parameters
Type |
Name |
Description |
Vector2 |
self |
|
Returns
Type |
Description |
System.Single |
|
Polar2Cart(Single, Single)
極座標の角度から直交座標系の値 new Vector2(Cos(degree * Deg2Rad) , Sin(degree * Deg2Rad)) を返す.
Declaration
public static Vector2 Polar2Cart(float degree, float radius = 1F)
Parameters
Type |
Name |
Description |
System.Single |
degree |
|
System.Single |
radius |
|
Returns
PutX(Vector2, Single)
Declaration
public static Vector2 PutX(this Vector2 self, float x)
Parameters
Type |
Name |
Description |
Vector2 |
self |
|
System.Single |
x |
|
Returns
PutY(Vector2, Single)
Declaration
public static Vector2 PutY(this Vector2 self, float y)
Parameters
Type |
Name |
Description |
Vector2 |
self |
|
System.Single |
y |
|
Returns
Rad2Vector(Single)
角度からVector2を生成. return new Vector2(Cosθ, Sinθ)を返す
Declaration
public static Vector2 Rad2Vector(float rad)
Parameters
Type |
Name |
Description |
System.Single |
rad |
|
Returns
RevScale(Vector2, Vector2)
Declaration
public static Vector2 RevScale(Vector2 a, Vector2 b)
Parameters
Type |
Name |
Description |
Vector2 |
a |
|
Vector2 |
b |
|
Returns
RevScaled(Vector2, Vector2)
new Vector2Int(self.x / div.x, self.y / div.y)
Declaration
public static Vector2 RevScaled(this Vector2 self, Vector2 div)
Parameters
Type |
Name |
Description |
Vector2 |
self |
|
Vector2 |
div |
|
Returns
Rotate(Vector2, Single)
Declaration
public static Vector2 Rotate(this Vector2 self, float degree)
Parameters
Type |
Name |
Description |
Vector2 |
self |
|
System.Single |
degree |
|
Returns
RotateTo(Vector2, Vector2, Single)
Declaration
public static Vector2 RotateTo(Vector2 from, Vector2 to, float maxRad)
Parameters
Type |
Name |
Description |
Vector2 |
from |
|
Vector2 |
to |
|
System.Single |
maxRad |
|
Returns
Scaled(Vector2, Vector2)
new Vector2Int(self.x * mul.x, self.y * mul.y)
Declaration
public static Vector2 Scaled(this Vector2 self, Vector2 mul)
Parameters
Type |
Name |
Description |
Vector2 |
self |
|
Vector2 |
mul |
|
Returns
Sin(Vector2)
Declaration
public static float Sin(this Vector2 self)
Parameters
Type |
Name |
Description |
Vector2 |
self |
|
Returns
Type |
Description |
System.Single |
|
Sum(Vector2)
Declaration
public static float Sum(this Vector2 self)
Parameters
Type |
Name |
Description |
Vector2 |
self |
|
Returns
Type |
Description |
System.Single |
|
Tan(Vector2)
Declaration
public static float Tan(this Vector2 self)
Parameters
Type |
Name |
Description |
Vector2 |
self |
|
Returns
Type |
Description |
System.Single |
|
ToVector2Int(Vector2)
Declaration
public static Vector2Int ToVector2Int(this Vector2 self)
Parameters
Type |
Name |
Description |
Vector2 |
self |
|
Returns
Type |
Description |
Vector2Int |
|
Xay(Vector2, Single)
yを指定してVector3にする
return new Vector3(self.x, y, self.y);
Declaration
public static Vector3 Xay(this Vector2 self, float y = 0F)
Parameters
Type |
Name |
Description |
Vector2 |
self |
|
System.Single |
y |
|
Returns
Xya(Vector2, Single)
zを指定してVector3にする
return new Vector3(self.x, self.y, z);
Declaration
public static Vector3 Xya(this Vector2 self, float z = 0F)
Parameters
Type |
Name |
Description |
Vector2 |
self |
|
System.Single |
z |
|
Returns