コード例 #1
0
ファイル: Vector2D.cs プロジェクト: Wiladams/NewTOAPIA
 static public Vector2D operator *(Vector2D A, double B)
 {
     Vector2D temp = new Vector2D();
     temp.x = A.x * B;
     temp.y = A.y * B;
     return temp;
 }
コード例 #2
0
ファイル: Vector2D.cs プロジェクト: Wiladams/NewTOAPIA
 static public Vector2D operator *(float B, Vector2D A)
 {
     Vector2D temp = new Vector2D();
     temp.x = A.x * (double)B;
     temp.y = A.y * (double)B;
     return temp;
 }
コード例 #3
0
ファイル: Vector2D.cs プロジェクト: Wiladams/NewTOAPIA
 static public Vector2D operator *(Vector2D A, Vector2D B)
 {
     Vector2D temp = new Vector2D();
     temp.x = A.x * B.x;
     temp.y = A.y * B.y;
     return temp;
 }
コード例 #4
0
ファイル: Vector2D.cs プロジェクト: Wiladams/NewTOAPIA
 public double Cross(Vector2D B)
 {
     return x * B.y - y * B.x;
 }
コード例 #5
0
ファイル: Vector2D.cs プロジェクト: Wiladams/NewTOAPIA
 public double GetDeltaAngle(Vector2D A)
 {
     return (double)GetDeltaAngle(GetAngle0To2PI(), A.GetAngle0To2PI());
 }
コード例 #6
0
ファイル: Vector2D.cs プロジェクト: Wiladams/NewTOAPIA
 public double Dot(Vector2D B)
 {
     return (x * B.x + y * B.y);
 }
コード例 #7
0
ファイル: Vector2D.cs プロジェクト: Wiladams/NewTOAPIA
 public static double GetDistanceBetweenSquared(Vector2D A, Vector2D B)
 {
     return ((A.x - B.x) * (A.x - B.x) + (A.y - B.y) * (A.y - B.y));
 }
コード例 #8
0
ファイル: Vector2D.cs プロジェクト: Wiladams/NewTOAPIA
 public double GetSquaredDistanceTo(Vector2D Other)
 {
     return ((x - Other.x) * (x - Other.x) + (y - Other.y) * (y - Other.y));
 }
コード例 #9
0
ファイル: Vector2D.cs プロジェクト: Wiladams/NewTOAPIA
 public static double GetDistanceBetween(Vector2D A, Vector2D B)
 {
     return (double)System.Math.Sqrt(GetDistanceBetweenSquared(A, B));
 }
コード例 #10
0
ファイル: Vector2D.cs プロジェクト: Wiladams/NewTOAPIA
        public Vector2D GetPerpendicular()
        {
            Vector2D temp = new Vector2D(y, -x);

            return temp;
        }
コード例 #11
0
ファイル: Vector2D.cs プロジェクト: Wiladams/NewTOAPIA
        // are they the same within the error value?
        public bool Equals(Vector2D OtherVector, double ErrorValue)
        {
            if ((x < OtherVector.x + ErrorValue && x > OtherVector.x - ErrorValue) &&
                (y < OtherVector.y + ErrorValue && y > OtherVector.y - ErrorValue))
            {
                return true;
            }

            return false;
        }
コード例 #12
0
ファイル: Vector2D.cs プロジェクト: Wiladams/NewTOAPIA
 static public Vector2D operator /(double B, Vector2D A)
 {
     Vector2D temp = new Vector2D();
     temp.x = A.x / B;
     temp.y = A.y / B;
     return temp;
 }
コード例 #13
0
ファイル: RenderBase.cs プロジェクト: Wiladams/NewTOAPIA
 public void Line(Vector2D Start, Vector2D End, RGBA_Bytes color)
 {
     Line(Start.x, Start.y, End.x, End.y, color);
 }