From 38932e64acccd46e79543d8d7c0edeaa42462906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zden=C4=9Bk=20Borovec?= Date: Tue, 5 Mar 2024 18:03:22 +0100 Subject: [PATCH] Added Lines --- structs/Line2d.cs | 29 +++++++++++++++++++++++++++++ structs/Line3d.cs | 29 +++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 structs/Line2d.cs create mode 100644 structs/Line3d.cs diff --git a/structs/Line2d.cs b/structs/Line2d.cs new file mode 100644 index 0000000..33113a6 --- /dev/null +++ b/structs/Line2d.cs @@ -0,0 +1,29 @@ +namespace GeometriCS.structs +{ + /// + /// A line through a two-dimensional vector space. + /// + public class Line2d + { + /// + /// A point that lies on the line. + /// + public Vector2d PointOnLine { get; set; } + + /// + /// Direction vector, along which all the points on the line lie. + /// + public Vector2d Direction { get; set; } + + /// + /// Constructor for the line. + /// + /// Point that lies on the line. + /// Direction vector on the line. + public Line2d(Vector2d pointOnLine, Vector2d direction) + { + PointOnLine = pointOnLine; + Direction = direction; + } + } +} diff --git a/structs/Line3d.cs b/structs/Line3d.cs new file mode 100644 index 0000000..886df73 --- /dev/null +++ b/structs/Line3d.cs @@ -0,0 +1,29 @@ +namespace GeometriCS.structs +{ + /// + /// A line through the R cubed space with double precision. + /// + public class Line3d + { + /// + /// A point that lies on the line. + /// + public Vector3d PointOnLine { get; set; } + + /// + /// Direction vector, along which all the points on the line lie. + /// + public Vector3d Direction { get; set; } + + /// + /// Constructor for the line. + /// + /// Point that lies on the line. + /// Direction vector on the line. + public Line3d(Vector3d pointOnLine, Vector3d direction) + { + PointOnLine = pointOnLine; + Direction = direction; + } + } +}