summaryrefslogtreecommitdiffstats
path: root/Master/CGuCAD/projects/Markus/PolyNode.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Master/CGuCAD/projects/Markus/PolyNode.cs')
-rw-r--r--Master/CGuCAD/projects/Markus/PolyNode.cs55
1 files changed, 55 insertions, 0 deletions
diff --git a/Master/CGuCAD/projects/Markus/PolyNode.cs b/Master/CGuCAD/projects/Markus/PolyNode.cs
new file mode 100644
index 0000000..1eb5d56
--- /dev/null
+++ b/Master/CGuCAD/projects/Markus/PolyNode.cs
@@ -0,0 +1,55 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Collections;
+using Autodesk.AutoCAD.Geometry;
+using System.IO;
+using System.Globalization;
+
+namespace Praktikum
+{
+ class PolyNode
+ {
+ public int iNodeIndex;
+ public Point2d p2DPoint;
+
+ public double GetWinkelPoint(PolyNode ZielPunkt)
+ {
+ return GetWinkelPoint(ZielPunkt.p2DPoint);
+ }
+
+ public double GetWinkelPoint(Point2d ZielPunkt)
+ {
+ return CalcAngle(GetAnglePointToPoint(p2DPoint, ZielPunkt));
+ }
+
+ private double CalcAngle(double dRadiant)
+ {
+ double RotationsWinkelGrad = dRadiant * 180.0f / Math.PI;
+
+ if (RotationsWinkelGrad < 0)
+ return 360 + RotationsWinkelGrad;
+ else
+ return RotationsWinkelGrad;
+ }
+
+ private double GetAnglePointToPoint(Point2d PAusgangspunkt, Point2d PKreispunkt)
+ {
+ return (double)(Math.Atan2((double)(PKreispunkt.Y - PAusgangspunkt.Y), (double)(PKreispunkt.X - PAusgangspunkt.X)));
+ }
+
+ public double Distance(Point2d p2dPunkt)
+ {
+ double xDist = (p2dPunkt.X - p2DPoint.X);
+ double yDist = (p2dPunkt.Y - p2DPoint.Y);
+
+ return (Math.Sqrt(xDist * xDist + yDist * yDist));
+ }
+
+ public double Distance(PolyNode p2dPunkt)
+ {
+ return Distance(p2dPunkt.p2DPoint);
+ }
+ }
+}
+