コード例 #1
0
ファイル: Vecteur2Tests.cs プロジェクト: Damien7877/Algogeo
 public void InitTest()
 {
     A = new Point2D(0, 0);
     B = new Point2D(0, 1);
     C = new Point2D(1, 0);
     D = new Point2D(1, 1);
 }
コード例 #2
0
ファイル: Point.cs プロジェクト: Damien7877/Algogeo
 public static Point2D operator -(Point2D p1, Point2D p2)
 {
     Point2D res = new Point2D();
     res.X = p1.X - p2.X;
     res.Y = p1.Y - p2.Y;
     return res;
 }
コード例 #3
0
ファイル: Point.cs プロジェクト: Damien7877/Algogeo
 public Point Add(Point other)
 {
     Point2D res = new Point2D();
     Point2D p2 = (Point2D)other;
     res.X = this.X + p2.X;
     res.Y = this.Y + p2.Y;
     return res;
 }
コード例 #4
0
ファイル: Point.cs プロジェクト: Damien7877/Algogeo
        public Point Rotate(double angle)
        {
            Point2D point = new Point2D();
            double angleInRad = angle * Math.PI / 180.0f;
            point.X = Math.Round(X * Math.Cos(angleInRad) - Y * Math.Sin(angleInRad));
            point.Y = Math.Round(X * Math.Sin(angleInRad) + Y * Math.Cos(angleInRad));

            return point;
        }