Esempio n. 1
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         Vector2D vec1 = new Vector2D();
         Vector2D vec2 = new Vector2D();
         Point2D center = new Point2D(2003.4945, 1103.6469);
         Point2D start = new Point2D(2494.6048, 982.6129);
         Point2D end = new Point2D(1499.1729, 1142.3536);
         Debug.WriteLine("distance between p1 p2 is : " + center.GetDistanceTo(start).ToString());
         Debug.WriteLine("distance between p2 p3 is : " + end.GetDistanceTo(start).ToString());
         Arc2D arc1 = new Arc2D(center, start, end);
         vec1 = center.GetVector2DTo(start);
         vec2 = center.GetVector2DTo(end);
     }
     catch (System.Exception ex)
     {
         Debug.WriteLine(ex.Message);
     }
 }
Esempio n. 2
0
 public bool IsCounterDirection(Vector2D v)
 {
     Double DeltaAngle = Math.Abs(Math.Abs(v.StartAngle - this.StartAngle)-Math.PI);
     return DeltaAngle > 0 && DeltaAngle < _precision;
 }
Esempio n. 3
0
 public bool IsSameDirection(Vector2D v)
 {
     Double DeltaAngle = Math.Abs(v.StartAngle-this.StartAngle) ;
     return DeltaAngle > 0 && DeltaAngle < _precision;
 }
Esempio n. 4
0
 public bool IsCounterClockWiseTo(Vector2D v)
 {
     Double DeltaAngle = v.StartAngle - this.StartAngle;
     return DeltaAngle > 0;
 }
Esempio n. 5
0
 public Double GetNormalAngleTo(Vector2D v)
 {
     Double DotProduction = this * v;
     Double projection = (DotProduction) / (this.Length * v.Length);
     return Math.Acos(projection);
 }
Esempio n. 6
0
 public Double GetBigAngleTo(Vector2D v)
 {
     Double angle = this.GetNormalAngleTo(v);
     return 2 * Math.PI - angle;
 }
Esempio n. 7
0
 public Double GetAngleTo(Vector2D v)
 {
     Double DeltaAngle = v.StartAngle - this.StartAngle;
     return DeltaAngle;
 }
Esempio n. 8
0
 /// <summary>
 /// Counter clock wise Cross-Production to Vector2D(v)
 /// as the two vectors are both on X-Y plane, their Cross-Production is on Z-Axis
 /// </summary>
 public Double CrossProductTo(Vector2D v)
 {
     return (this.X * v.Y - this.Y * v.X);
 }