/// <summary> /// Checks whether the two points are spatially equal /// </summary> /// <param name="p1">Point 1</param> /// <param name="p2">Point 2</param> /// <returns>true if the points a spatially equal</returns> public Boolean Equals(Point3D p1, Point3D p2) { return(p1.X == p2.X && p1.Y == p2.Y && p1.Z == p2.Z); }
/// <summary> /// Comparator used for ordering point first by ascending X, then by ascending Y and then by ascending Z. /// </summary> /// <param name="other"></param> /// <returns></returns> public virtual Int32 CompareTo(Point3D other) { if (X < other.X || X == other.X && Y < other.Y || X == other.X && Y == other.Y && Z < other.Z) return -1; else if (X > other.X || X == other.X && Y > other.Y || X == other.X && Y == other.Y && Z > other.Z) return 1; else // (this.X == other.X && this.Y == other.Y && this.Z == other.Z) return 0; }
///// <summary> ///// Vector + Vector ///// </summary> ///// <param name="v1">Vector</param> ///// <param name="v2">Vector</param> ///// <returns></returns> //public static Point3D operator +(Point3D v1, Point3D v2) //{ // return new Point3D(v1.X + v2.X, v1.Y + v2.Y, v1.Z + v2.Z); //} ///// <summary> ///// Vector - Vector ///// </summary> ///// <param name="v1">Vector</param> ///// <param name="v2">Vector</param> ///// <returns>Cross product</returns> //public static Point3D operator -(Point3D v1, Point3D v2) //{ // return new Point3D(v1.X - v2.X, v1.Y - v2.Y, v1.Z - v2.Z); //} ///// <summary> ///// Vector * Scalar ///// </summary> ///// <param name="m">Vector</param> ///// <param name="d">Scalar (Double)</param> ///// <returns></returns> //public static Point3D operator *(Point3D m, Double d) //{ // return new Point3D(m.X*d, m.Y*d, m.Z*d); //} #endregion #region "Inherited methods from abstract class Geometry" /// <summary> /// Checks whether this instance is spatially equal to the Point 'o' /// </summary> /// <param name="p">Point to compare to</param> /// <returns></returns> public Boolean Equals(Point3D p) { return(base.Equals(p) && p.Z == _z); }
/// <summary> /// Checks whether the two points are spatially equal /// </summary> /// <param name="p1">Point 1</param> /// <param name="p2">Point 2</param> /// <returns>true if the points a spatially equal</returns> public Boolean Equals(Point3D p1, Point3D p2) { return (p1.X == p2.X && p1.Y == p2.Y && p1.Z == p2.Z); }
///// <summary> ///// Vector + Vector ///// </summary> ///// <param name="v1">Vector</param> ///// <param name="v2">Vector</param> ///// <returns></returns> //public static Point3D operator +(Point3D v1, Point3D v2) //{ // return new Point3D(v1.X + v2.X, v1.Y + v2.Y, v1.Z + v2.Z); //} ///// <summary> ///// Vector - Vector ///// </summary> ///// <param name="v1">Vector</param> ///// <param name="v2">Vector</param> ///// <returns>Cross product</returns> //public static Point3D operator -(Point3D v1, Point3D v2) //{ // return new Point3D(v1.X - v2.X, v1.Y - v2.Y, v1.Z - v2.Z); //} ///// <summary> ///// Vector * Scalar ///// </summary> ///// <param name="m">Vector</param> ///// <param name="d">Scalar (Double)</param> ///// <returns></returns> //public static Point3D operator *(Point3D m, Double d) //{ // return new Point3D(m.X*d, m.Y*d, m.Z*d); //} #endregion #region "Inherited methods from abstract class Geometry" /// <summary> /// Checks whether this instance is spatially equal to the Point 'o' /// </summary> /// <param name="p">Point to compare to</param> /// <returns></returns> public Boolean Equals(Point3D p) { return base.Equals(p) && p.Z == _z; }
public IPoint3D CreatePoint3D(IPoint2D point2D, Double z) { Point3D p = new Point3D(this, point2D.X, point2D.Y, z); return p; }
public IPoint3D CreatePoint3D(Double x, Double y, Double z) { Point3D p = new Point3D(this, x, y, z); return p; }
public IPoint3D CreatePoint3D() { Point3D p = new Point3D(); p.Factory = this; return p; }