예제 #1
0
파일: Vector2D.cs 프로젝트: Kintaro/Pictor
 public static Vector2D operator *(float B, Vector2D A)
 {
     Vector2D temp = new Vector2D ();
     temp.x = A.x * (double)B;
     temp.y = A.y * (double)B;
     return temp;
 }
예제 #2
0
파일: Vector2D.cs 프로젝트: Kintaro/Pictor
 public static Vector2D operator -(Vector2D A, Vector2D B)
 {
     Vector2D temp = new Vector2D ();
     temp.x = A.x - B.x;
     temp.y = A.y - B.y;
     return temp;
 }
예제 #3
0
파일: Vector2D.cs 프로젝트: Kintaro/Pictor
 public static Vector2D operator *(Vector2D A, double B)
 {
     Vector2D temp = new Vector2D ();
     temp.x = A.x * B;
     temp.y = A.y * B;
     return temp;
 }
예제 #4
0
파일: Vector2D.cs 프로젝트: Kintaro/Pictor
 public double GetSquaredDistanceTo(Vector2D Other)
 {
     return ((x - Other.x) * (x - Other.x) + (y - Other.y) * (y - Other.y));
 }
예제 #5
0
파일: Vector2D.cs 프로젝트: Kintaro/Pictor
 public double GetDeltaAngle(Vector2D A)
 {
     return (double)GetDeltaAngle (GetAngle0To2PI (), A.GetAngle0To2PI ());
 }
예제 #6
0
파일: Vector2D.cs 프로젝트: Kintaro/Pictor
        public Vector2D GetPerpendicular()
        {
            Vector2D temp = new Vector2D (y, -x);

            return temp;
        }
예제 #7
0
파일: Vector2D.cs 프로젝트: Kintaro/Pictor
 public double Dot(Vector2D B)
 {
     return (x * B.x + y * B.y);
 }
예제 #8
0
파일: Vector2D.cs 프로젝트: Kintaro/Pictor
        // 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;
        }
예제 #9
0
파일: Vector2D.cs 프로젝트: Kintaro/Pictor
 public double Cross(Vector2D B)
 {
     return x * B.y - y * B.x;
 }
예제 #10
0
파일: Vector2D.cs 프로젝트: Kintaro/Pictor
 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));
 }
예제 #11
0
파일: Vector2D.cs 프로젝트: Kintaro/Pictor
 public static double GetDistanceBetween(Vector2D A, Vector2D B)
 {
     return (double)System.Math.Sqrt (GetDistanceBetweenSquared (A, B));
 }
예제 #12
0
파일: Vector2D.cs 프로젝트: Kintaro/Pictor
 public static Vector2D operator /(double B, Vector2D A)
 {
     Vector2D temp = new Vector2D ();
     temp.x = A.x / B;
     temp.y = A.y / B;
     return temp;
 }
예제 #13
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="Start">
 /// A <see cref="Vector2D"/>
 /// </param>
 /// <param name="End">
 /// A <see cref="Vector2D"/>
 /// </param>
 /// <param name="color">
 /// A <see cref="RgbaBytes"/>
 /// </param>
 public void Line(Vector2D Start, Vector2D End, RgbaBytes color)
 {
     Line (Start.x, Start.y, End.x, End.y, color);
 }