Search Results for

    Show / Hide Table of Contents

    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()
    Namespace: PLATEAU.Util
    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
    Type Description
    Vector2

    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)

    (self.x + self.y) / 2

    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
    Type Description
    Vector2

    Clamp(Vector2, Single, Single)

    各要素をmin, maxでクランプ

    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
    Type Description
    Vector2

    Clamp(Vector2, Vector2, Vector2)

    各要素をmin,maxの各要素でクランプ

    Declaration
    public static Vector2 Clamp(this Vector2 x, Vector2 min, Vector2 max)
    Parameters
    Type Name Description
    Vector2 x
    Vector2 min
    Vector2 max
    Returns
    Type Description
    Vector2

    Cos(Vector2)

    self.x / self.magnitude

    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
    Type Description
    Vector2

    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
    Type Description
    Vector2

    PutX(Vector2, Single)

    xを差し替えたVector2返す。非破壊

    Declaration
    public static Vector2 PutX(this Vector2 self, float x)
    Parameters
    Type Name Description
    Vector2 self
    System.Single x
    Returns
    Type Description
    Vector2

    PutY(Vector2, Single)

    yを差し替えたVector2返す。非破壊

    Declaration
    public static Vector2 PutY(this Vector2 self, float y)
    Parameters
    Type Name Description
    Vector2 self
    System.Single y
    Returns
    Type Description
    Vector2

    Rad2Vector(Single)

    角度からVector2を生成. return new Vector2(Cosθ, Sinθ)を返す

    Declaration
    public static Vector2 Rad2Vector(float rad)
    Parameters
    Type Name Description
    System.Single rad
    Returns
    Type Description
    Vector2

    RevScale(Vector2, Vector2)

    Vector2.Scaleの逆数版 a / b

    Declaration
    public static Vector2 RevScale(Vector2 a, Vector2 b)
    Parameters
    Type Name Description
    Vector2 a
    Vector2 b
    Returns
    Type Description
    Vector2

    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
    Type Description
    Vector2

    Rotate(Vector2, Single)

    時計回りに回転した結果を返す

    Declaration
    public static Vector2 Rotate(this Vector2 self, float degree)
    Parameters
    Type Name Description
    Vector2 self
    System.Single degree
    Returns
    Type Description
    Vector2

    RotateTo(Vector2, Vector2, Single)

    from -> toに最大maxRad回転させる

    Declaration
    public static Vector2 RotateTo(Vector2 from, Vector2 to, float maxRad)
    Parameters
    Type Name Description
    Vector2 from
    Vector2 to
    System.Single maxRad
    Returns
    Type Description
    Vector2

    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
    Type Description
    Vector2

    Sin(Vector2)

    self.y / self.magnitude

    Declaration
    public static float Sin(this Vector2 self)
    Parameters
    Type Name Description
    Vector2 self
    Returns
    Type Description
    System.Single

    Sum(Vector2)

    self.x + self.y

    Declaration
    public static float Sum(this Vector2 self)
    Parameters
    Type Name Description
    Vector2 self
    Returns
    Type Description
    System.Single

    Tan(Vector2)

    self.y / self.x

    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
    Type Description
    Vector3

    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
    Type Description
    Vector3
    In This Article
    Back to top PLATEAU SDK for Unity