diff --git a/intersections/IntersectionLine2ToLine2.cs b/intersections/IntersectionLine2ToLine2.cs
new file mode 100644
index 0000000..117bd65
--- /dev/null
+++ b/intersections/IntersectionLine2ToLine2.cs
@@ -0,0 +1,57 @@
+namespace GeometriCS
+{
+ ///
+ /// Intersection between two two-dimensional lines.
+ ///
+ public class IntersectionLine2ToLine2d
+ {
+ ///
+ /// Possible statuses the intersection can be.
+ ///
+ public enum Statuses
+ {
+ ///
+ /// Intersection is valid.
+ ///
+ SUCCESS,
+ ///
+ /// The two lines are parallel.
+ ///
+ PARALLEL,
+ }
+
+ ///
+ /// First of the intersecting lines.
+ ///
+ public Line2d Line1 { get; }
+
+ ///
+ /// The second intersecting line.
+ ///
+ public Line2d Line2 { get; }
+
+ ///
+ /// Status of the intersection.
+ ///
+ public Statuses Status { get; }
+
+ ///
+ /// The point of the intersection between the two lines.
+ ///
+ public Vector2d? Result { get; }
+
+ ///
+ /// Constructor for Line2d to Line2d intersection.
+ ///
+ /// First of the intersecting lines.
+ /// Second of the intersecting lines.
+ public IntersectionLine2ToLine2d(Line2d line1, Line2d line2)
+ {
+ Line1 = line1;
+ Line2 = line2;
+
+ // Process the intersection
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/intersections/IntersectionLine2ToLineSegment2.cs b/intersections/IntersectionLine2ToLineSegment2.cs
new file mode 100644
index 0000000..e517e7c
--- /dev/null
+++ b/intersections/IntersectionLine2ToLineSegment2.cs
@@ -0,0 +1,61 @@
+namespace GeometriCS
+{
+ ///
+ /// Intersection between a line and a line segment
+ ///
+ public class IntersectionLine2ToLineSegment2d
+ {
+ ///
+ /// Possible statuses the intersection can be.
+ ///
+ public enum Statuses
+ {
+ ///
+ /// Intersection is valid.
+ ///
+ SUCCESS,
+ ///
+ /// The two lines are parallel.
+ ///
+ PARALLEL,
+ ///
+ /// The intersection would happen if the intersectors were unbounded, but not inside the bounds.
+ ///
+ OUTOFBOUNDS,
+ }
+
+ ///
+ /// The intersecting line.
+ ///
+ public Line2d Line { get; }
+
+ ///
+ /// The intersecting line segment.
+ ///
+ public LineSegment2d LineSegment { get; }
+
+ ///
+ /// Status of the intersection.
+ ///
+ public Statuses Status { get; }
+
+ ///
+ /// The point of the intersection between the line and line segment.
+ ///
+ public Vector2d? Result { get; }
+
+ ///
+ /// Constructor for Line2d to LinearSegment2d intersection.
+ ///
+ /// The intersecting line.
+ /// The intersecting lineSegment.
+ public IntersectionLine2ToLineSegment2d(Line2d line, LineSegment2d lineSegment)
+ {
+ Line = line;
+ LineSegment = lineSegment;
+
+ // Process the intersection
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/intersections/IntersectionPlaneToLine3.cs b/intersections/IntersectionPlaneToLine3.cs
new file mode 100644
index 0000000..28c4896
--- /dev/null
+++ b/intersections/IntersectionPlaneToLine3.cs
@@ -0,0 +1,57 @@
+namespace GeometriCS
+{
+ ///
+ /// Intersection between a plane and a line3, double precision.
+ ///
+ public class IntersectionPlaneToLine3d
+ {
+ ///
+ /// Possible statuses the intersection can be.
+ ///
+ public enum Statuses
+ {
+ ///
+ /// Intersection is valid.
+ ///
+ SUCCESS,
+ ///
+ /// The line is on a plane coplanar to the intersection plane.
+ ///
+ COPLANAR,
+ }
+
+ ///
+ /// The intersecting plane.
+ ///
+ public Planed Plane { get; }
+
+ ///
+ /// The intersecting line.
+ ///
+ public Line3d Line { get; }
+
+ ///
+ /// Status of the intersection.
+ ///
+ public Statuses Status { get; }
+
+ ///
+ /// Point on the intersection of the plane and the line.
+ ///
+ public Vector3d? Result { get; }
+
+ ///
+ /// Constructor for Planed to Line3d intersection.
+ ///
+ /// The intersecting plane.
+ /// The intersecting line.
+ public IntersectionPlaneToLine3d(Planed plane, Line3d line)
+ {
+ Plane = plane;
+ Line = line;
+
+ // Process the intersection
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/intersections/IntersectionPlaneToPlane.cs b/intersections/IntersectionPlaneToPlane.cs
new file mode 100644
index 0000000..059452e
--- /dev/null
+++ b/intersections/IntersectionPlaneToPlane.cs
@@ -0,0 +1,57 @@
+namespace GeometriCS
+{
+ ///
+ /// Intersection between two planes, double precision.
+ ///
+ public struct IntersectionPlaneToPlaned
+ {
+ ///
+ /// Possible statuses the intersection can be.
+ ///
+ public enum Statuses
+ {
+ ///
+ /// Intersection is valid.
+ ///
+ SUCCESS,
+ ///
+ /// The two intersecting planes are coplanar.
+ ///
+ COPLANAR,
+ }
+
+ ///
+ /// First of the intersecting planes.
+ ///
+ public Planed Plane1 { get; }
+
+ ///
+ /// The second intersecting plane.
+ ///
+ public Planed Plane2 { get; }
+
+ ///
+ /// Status of the intersection.
+ ///
+ public Statuses Status { get; }
+
+ ///
+ /// Resulting intersection line between the two planes.
+ ///
+ public Line3d? Result { get; }
+
+ ///
+ /// Constructor for Planed to Planed intersection.
+ ///
+ /// First of the intersecting planes.
+ /// Second of the intersecting planes.
+ public IntersectionPlaneToPlaned(Planed plane1, Planed plane2)
+ {
+ Plane1 = plane1;
+ Plane2 = plane2;
+
+ // Process the intersection.
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/structs/Line2.cs b/structs/Line2.cs
new file mode 100644
index 0000000..62577ae
--- /dev/null
+++ b/structs/Line2.cs
@@ -0,0 +1,135 @@
+using System.Runtime.CompilerServices;
+
+namespace GeometriCS
+{
+ ///
+ /// A line through a two-dimensional vector space.
+ ///
+ ///
+ /// Line follows the equation Ax + By + C = 0
+ ///
+ public class Line2d
+ {
+ ///
+ /// A coefficient of the line.
+ ///
+ ///
+ /// Line follows the equation Ax + By + C = 0
+ ///
+ public double Coeff_A { get; set; }
+
+ ///
+ /// B coefficient of the line.
+ ///
+ ///
+ /// Line follows the equation Ax + By + C = 0
+ ///
+ public double Coeff_B { get; set; }
+
+ ///
+ /// C coefficient of the line.
+ ///
+ ///
+ /// Line follows the equation Ax + By + C = 0
+ ///
+ public double Coeff_C { get; set; }
+
+ ///
+ /// Construct a line from a point on the line and a direction vector.
+ ///
+ /// Point that lies on the line.
+ /// Direction the line takes from the point.
+ /// Line2d passing throught the given point with the given direction.
+ public static Line2d FromPointAndDirection(Vector2d pointOnLine, Vector2d direction)
+ {
+ throw new NotImplementedException();
+ }
+
+ ///
+ /// Construct a line passing through two given points.
+ ///
+ /// First point that lies on the line.
+ /// Other point that lies on the line.
+ /// Line passing through the two points.
+ public static Line2d FromTwoPoints(Vector2d firstPoint, Vector2d secondPoint)
+ {
+ throw new NotImplementedException();
+ }
+
+ ///
+ /// Construct the line from its coefficients.
+ ///
+ ///
+ ///
+ ///
+ public Line2d(double coeff_A, double coeff_B, double coeff_C)
+ {
+ Coeff_A = coeff_A;
+ Coeff_B = coeff_B;
+ Coeff_C = coeff_C;
+ }
+
+ ///
+ /// String representation of the line.
+ ///
+ ///
+ public override string ToString()
+ {
+ throw new NotImplementedException();
+ }
+
+ ///
+ /// Do the two objects represent the same line?
+ ///
+ /// Object to compare.
+ ///
+ /// true if the lines have the same coefficients. Otherwise false
+ public override bool Equals(object? obj)
+ {
+ if (obj is Line2d asLn)
+ {
+ return this == asLn;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ public override int GetHashCode()
+ {
+ return HashCode.Combine(Coeff_A, Coeff_B, Coeff_C);
+ }
+
+ ///
+ /// Deep copy the line.
+ ///
+ /// Deep copy of the line.
+ public object Clone()
+ {
+ return new Line2d(Coeff_A, Coeff_B, Coeff_C);
+ }
+
+ ///
+ /// Are the lines equal?
+ ///
+ /// First line.
+ /// Second line.
+ /// true if the lines have the same start and end points. Otherwise false
+ public static bool operator ==(Line2d a, Line2d b)
+ {
+ return Utils.DoubleEquals(a.Coeff_A, b.Coeff_A) && Utils.DoubleEquals(a.Coeff_B, b.Coeff_B) && Utils.DoubleEquals(a.Coeff_C, b.Coeff_C);
+ }
+
+ ///
+ /// Are the lines different?
+ ///
+ /// First line.
+ /// Second line.
+ /// true If the lines have the same coefficients. Otherwise false.
+ public static bool operator !=(Line2d a, Line2d b)
+ {
+ return !(a == b);
+ }
+ }
+}
diff --git a/structs/Line2d.cs b/structs/Line2d.cs
deleted file mode 100644
index 33113a6..0000000
--- a/structs/Line2d.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-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/Line3.cs b/structs/Line3.cs
new file mode 100644
index 0000000..2bb8cc8
--- /dev/null
+++ b/structs/Line3.cs
@@ -0,0 +1,103 @@
+namespace GeometriCS
+{
+ ///
+ /// A line through the R cubed space with double precision.
+ ///
+ public class Line3d
+ {
+ ///
+ /// A point that lies on the line.
+ ///
+ public Vector3d PointOnLine
+ {
+ get
+ {
+ throw new NotImplementedException();
+ }
+ }
+
+ ///
+ /// Direction vector, along which all the points on the line lie.
+ ///
+ public Vector3d Direction
+ {
+ get
+ {
+ throw new NotImplementedException();
+ }
+ }
+
+ ///
+ /// Constructor for the line.
+ ///
+ /// Point that lies on the line.
+ /// Direction vector on the line.
+ public Line3d(Vector3d pointOnLine, Vector3d direction)
+ {
+ throw new NotImplementedException();
+ }
+
+ ///
+ /// String representation of the line.
+ ///
+ ///
+ public override string ToString()
+ {
+ throw new NotImplementedException();
+ }
+
+ ///
+ /// Do the two objects represent the same line?
+ ///
+ /// Object to compare.
+ ///
+ /// true if any two different points on one line will also be on the other line. false
+ public override bool Equals(object? obj)
+ {
+ if (obj is Line3d asLn)
+ {
+ return this == asLn;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ public override int GetHashCode()
+ {
+ throw new NotImplementedException();
+ }
+
+ ///
+ /// Deep copy the line.
+ ///
+ /// Deep copy of the line.
+ public object Clone()
+ {
+ throw new NotImplementedException();
+ }
+
+ ///
+ /// Are the lines equal?
+ ///
+ /// First line.
+ /// Second line.
+ /// true if any two different points on one line will also be on the other line. false
+ public static bool operator ==(Line3d a, Line3d b)
+ {
+ throw new NotImplementedException();
+ }
+
+ ///
+ /// Are the lines different?
+ ///
+ /// First line.
+ /// Second line.
+ /// true If there exists a point p from all the points occupying line a and does not lie on line b. Otherwise false.
+ public static bool operator !=(Line3d a, Line3d b)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/structs/Line3d.cs b/structs/Line3d.cs
deleted file mode 100644
index 886df73..0000000
--- a/structs/Line3d.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-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;
- }
- }
-}
diff --git a/structs/LineSegment2.cs b/structs/LineSegment2.cs
new file mode 100644
index 0000000..d3d1e0f
--- /dev/null
+++ b/structs/LineSegment2.cs
@@ -0,0 +1,100 @@
+namespace GeometriCS
+{
+ ///
+ /// A segment of a two-dimensional line with double precision.
+ ///
+ public class LineSegment2d
+ {
+ ///
+ /// Start point of the line.
+ ///
+ public Vector2d StartPoint { get; set; }
+
+ ///
+ /// End point of the line.
+ ///
+ public Vector2d EndPoint { get; set;}
+
+ ///
+ /// A constructor for a 2d line segment.
+ ///
+ /// Point at which the line starts.
+ /// Point at which the line ends.
+ public LineSegment2d(Vector2d startPoint, Vector2d endPoint)
+ {
+ StartPoint = (Vector2d) startPoint.Clone();
+ EndPoint = (Vector2d) endPoint.Clone();
+ }
+
+ ///
+ /// String representation of the line segment.
+ ///
+ /// (stPt) -- (endPt)
+ public override string ToString()
+ {
+ return $"({StartPoint} -- {EndPoint})";
+ }
+
+ ///
+ /// Do the two objects represent the same line segment?
+ ///
+ /// Object to compare.
+ ///
+ /// If this lines start point is equal to the other lines end point,
+ /// and this lines end point is equal to the other lines start point, the lines will be considered equal.
+ ///
+ /// true if the lines have the same start and end points. Otherwise false
+ public override bool Equals(object? obj)
+ {
+ if (obj is LineSegment2d asLnSgmnt)
+ {
+ return this == asLnSgmnt;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ public override int GetHashCode()
+ {
+ return HashCode.Combine(StartPoint, EndPoint);
+ }
+
+ ///
+ /// Deep copy the line.
+ ///
+ /// Deep copy of the line.
+ public object Clone()
+ {
+ return new LineSegment2d(StartPoint, EndPoint);
+ }
+
+ ///
+ /// Are the line segments equal?
+ ///
+ /// First line segment.
+ /// Second line segment.
+ ///
+ /// If this lines start point is equal to the other lines end point,
+ /// and this lines end point is equal to the other lines start point, the lines will be considered equal.
+ ///
+ /// true if the lines have the same start and end points. Otherwise false
+ public static bool operator ==(LineSegment2d a, LineSegment2d b)
+ {
+ return (a.StartPoint == b.StartPoint && a.EndPoint == b.EndPoint) ||
+ (a.StartPoint == b.EndPoint && a.EndPoint == b.StartPoint);
+ }
+
+ ///
+ /// Are the line segments different?
+ ///
+ /// First line segment.
+ /// Second line segment.
+ /// true If the line segments start or end points are different from the other ones. false If both are same, refer to for details.
+ public static bool operator !=(LineSegment2d a, LineSegment2d b)
+ {
+ return !(a == b);
+ }
+ }
+}
diff --git a/structs/LineSegment3.cs b/structs/LineSegment3.cs
new file mode 100644
index 0000000..6aae0f6
--- /dev/null
+++ b/structs/LineSegment3.cs
@@ -0,0 +1,100 @@
+namespace GeometriCS
+{
+ ///
+ /// A segment of a line going through the R cubed space.
+ ///
+ public class LineSegment3d
+ {
+ ///
+ /// Point at which the line segment starts.
+ ///
+ public Vector3d StartPoint { get; set; }
+
+ ///
+ /// Point at which the line segment ends.
+ ///
+ public Vector3d EndPoint { get; set; }
+
+ ///
+ /// A constructor for a segment of a line going throught the R cubed space.
+ ///
+ /// Start point of the line.
+ /// End point of the line.
+ public LineSegment3d(Vector3d startPoint, Vector3d endPoint)
+ {
+ StartPoint = (Vector3d) startPoint.Clone();
+ EndPoint = (Vector3d) endPoint.Clone();
+ }
+
+ ///
+ /// String representation of the line segment.
+ ///
+ /// (stPt) -- (endPt)
+ public override string ToString()
+ {
+ return $"({StartPoint} -- {EndPoint})";
+ }
+
+ ///
+ /// Do the two objects represent the same line segment?
+ ///
+ /// Object to compare.
+ ///
+ /// If this lines start point is equal to the other lines end point,
+ /// and this lines end point is equal to the other lines start point, the lines will be considered equal.
+ ///
+ /// true if the lines have the same start and end points. Otherwise false
+ public override bool Equals(object? obj)
+ {
+ if (obj is LineSegment3d asLnSgmnt)
+ {
+ return this == asLnSgmnt;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ public override int GetHashCode()
+ {
+ return HashCode.Combine(StartPoint, EndPoint);
+ }
+
+ ///
+ /// Deep copy the line.
+ ///
+ /// Deep copy of the line.
+ public object Clone()
+ {
+ return new LineSegment3d(StartPoint, EndPoint);
+ }
+
+ ///
+ /// Are the line segments equal?
+ ///
+ /// First line segment.
+ /// Second line segment.
+ ///
+ /// If this lines start point is equal to the other lines end point,
+ /// and this lines end point is equal to the other lines start point, the lines will be considered equal.
+ ///
+ /// true if the lines have the same start and end points. Otherwise false
+ public static bool operator ==(LineSegment3d a, LineSegment3d b)
+ {
+ return (a.StartPoint == b.StartPoint && a.EndPoint == b.EndPoint) ||
+ (a.StartPoint == b.EndPoint && a.EndPoint == b.StartPoint);
+ }
+
+ ///
+ /// Are the line segments different?
+ ///
+ /// First line segment.
+ /// Second line segment.
+ /// true If the line segments start or end points are different from the other ones. false If both are same, refer to for details.
+ public static bool operator !=(LineSegment3d a, LineSegment3d b)
+ {
+ return !(a == b);
+ }
+ }
+}
diff --git a/structs/Plane.cs b/structs/Plane.cs
new file mode 100644
index 0000000..aaa2135
--- /dev/null
+++ b/structs/Plane.cs
@@ -0,0 +1,153 @@
+namespace GeometriCS
+{
+ ///
+ /// Euclidean plane with double precision.
+ ///
+ ///
+ /// Plane follows the equation Ax + By + Cz - D = 0
+ ///
+ public class Planed
+ {
+ ///
+ /// A coefficient of the plane.
+ ///
+ ///
+ /// Plane follows the equation Ax + By + Cz - D = 0
+ ///
+ public double Coeff_A { get; set; }
+
+ ///
+ /// B coefficient of the plane.
+ ///
+ ///
+ /// Plane follows the equation Ax + By + Cz - D = 0
+ ///
+ public double Coeff_B { get; set; }
+
+ ///
+ /// C coefficient of the plane.
+ ///
+ ///
+ /// Plane follows the equation Ax + By + Cz - D = 0
+ ///
+ public double Coeff_C { get; set; }
+
+ ///
+ /// D coefficient of the plane.
+ ///
+ ///
+ /// Plane follows the equation Ax + By + Cz - D = 0
+ ///
+ public double Coeff_D { get; set; }
+
+ ///
+ /// Normal vector to the plane.
+ ///
+ public Vector3d Normal => new Vector3d(Coeff_A, Coeff_B, Coeff_C);
+
+ ///
+ /// Distance of the plane from origin along the normal vector. (signed!)
+ ///
+ public double Distance => -Coeff_D;
+
+ ///
+ /// Construct the plane from its normal and distance from origin.
+ ///
+ /// Normal vector of the plane.
+ /// Distance from origin along normal.
+ public Planed(Vector3d normal, double distance)
+ {
+ Coeff_A = normal.X;
+ Coeff_B = normal.Y;
+ Coeff_C = normal.Z;
+ Coeff_D = -distance;
+ }
+
+ ///
+ /// Construct the plane from its normal and distance from origin.
+ ///
+ /// A coefficient of the plane.
+ /// B coefficient of the plane.
+ /// C coefficient of the plane.
+ /// D coefficient of the plane.
+ ///
+ /// Plane follows the equation Ax + By + Cz - D = 0
+ ///
+ public Planed(double coeff_a, double coeff_b, double coeff_c, double coeff_d)
+ {
+ Coeff_A = coeff_a;
+ Coeff_B = coeff_b;
+ Coeff_C = coeff_c;
+ Coeff_D = coeff_d;
+ }
+
+ ///
+ /// String representation of the plane.
+ ///
+ /// (normal vector, distance from origin)
+ public override string ToString()
+ {
+ return $"({Normal}, {Distance})";
+ }
+
+ ///
+ /// Do the two objects represent the same plane?
+ ///
+ /// Object to compare.
+ ///
+ /// If the planes have inverse normals and also inverse distances, they are considered not equal despite looking the same.
+ ///
+ /// true If the planes have the same coefficients. false
+ public override bool Equals(object? obj)
+ {
+ if (obj is Planed asPlane)
+ {
+ return this == asPlane;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ public override int GetHashCode()
+ {
+ return HashCode.Combine(Coeff_A, Coeff_B, Coeff_C, Coeff_D);
+ }
+
+ ///
+ /// Deep copy the plane.
+ ///
+ /// Deep copy of the plane.
+ public object Clone()
+ {
+ return new Planed(Coeff_A, Coeff_B, Coeff_C, Coeff_D);
+ }
+
+ ///
+ /// Are the planes equal?
+ ///
+ /// First plane.
+ /// Second plane.
+ ///
+ /// If the planes have inverse normals and also inverse distances, they are considered not equal despite looking the same.
+ ///
+ /// true If the planes have the same coefficients. false
+ public static bool operator ==(Planed a, Planed b)
+ {
+ return a.Coeff_A == b.Coeff_A && a.Coeff_B == b.Coeff_B &&
+ a.Coeff_C == b.Coeff_C && a.Coeff_D == b.Coeff_D;
+ }
+
+ ///
+ /// Are the planes different?
+ ///
+ /// First plane.
+ /// Second plane.
+ /// true If either the normals or the distance differs, otherwise false.
+ public static bool operator !=(Planed a, Planed b)
+ {
+ return !(a == b);
+ }
+ }
+}
diff --git a/structs/Vector2d.cs b/structs/Vector2.cs
similarity index 96%
rename from structs/Vector2d.cs
rename to structs/Vector2.cs
index e954beb..824b3d0 100644
--- a/structs/Vector2d.cs
+++ b/structs/Vector2.cs
@@ -1,11 +1,9 @@
-using System.Diagnostics.CodeAnalysis;
-
-namespace GeometriCS.structs
+namespace GeometriCS
{
///
/// Two-dimensional vector with double precision.
///
- public struct Vector2d
+ public class Vector2d : ICloneable
{
///
/// Vector with 0 length.
@@ -151,7 +149,7 @@ namespace GeometriCS.structs
///
/// Object to compare.
/// true if the vectors are equal. Otherwise false
- public override bool Equals([NotNullWhen(true)] object? obj)
+ public override bool Equals(object? obj)
{
if (obj is Vector2d asVect)
{
@@ -168,6 +166,15 @@ namespace GeometriCS.structs
return HashCode.Combine(X, Y);
}
+ ///
+ /// Deep copy the vector.
+ ///
+ /// Deep copy of the vector.
+ public object Clone()
+ {
+ return new Vector2d(X, Y);
+ }
+
///
/// Negation of the vector.
///
diff --git a/structs/Vector3d.cs b/structs/Vector3.cs
similarity index 96%
rename from structs/Vector3d.cs
rename to structs/Vector3.cs
index 998bb25..8bb9050 100644
--- a/structs/Vector3d.cs
+++ b/structs/Vector3.cs
@@ -1,11 +1,9 @@
-using System.Diagnostics.CodeAnalysis;
-
-namespace GeometriCS.structs
+namespace GeometriCS
{
///
/// Three-dimensional vector with double precision.
///
- public struct Vector3d
+ public class Vector3d : ICloneable
{
///
/// Vector with 0 length.
@@ -164,7 +162,7 @@ namespace GeometriCS.structs
///
/// Object to compare.
/// true if the vectors are equal. Otherwise false
- public override bool Equals([NotNullWhen(true)] object? obj)
+ public override bool Equals(object? obj)
{
if (obj is Vector3d asVect)
{
@@ -181,6 +179,15 @@ namespace GeometriCS.structs
return HashCode.Combine(X, Y, Z);
}
+ ///
+ /// Deep copy the vector.
+ ///
+ /// Deep copy of the vector.
+ public object Clone()
+ {
+ return new Vector3d(X, Y, Z);
+ }
+
///
/// Negation of the vector.
///
diff --git a/utils/Utils.cs b/utils/Utils.cs
index ba5a87e..ac149b6 100644
--- a/utils/Utils.cs
+++ b/utils/Utils.cs
@@ -1,10 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace GeometriCS
+namespace GeometriCS
{
///
/// Common utilities throughout the library.