/// <summary> /// Constructors a point by projecting a point on a plane with given project direction. /// </summary> /// <param name="contextPlane">Plane of projection</param> /// <param name="direction">Projection direction</param> /// <returns>Point</returns> public Point Project(Plane contextPlane, Vector direction) { if (contextPlane == null) { throw new ArgumentNullException("contextPlane"); } else if (direction == null) { throw new ArgumentNullException("direction"); } else if (direction.IsZeroVector()) { throw new ArgumentException(string.Format(Properties.Resources.IsZeroVector, "direction")); } else if (direction.IsPerpendicular(contextPlane.Normal)) { throw new ArgumentException(string.Format(Properties.Resources.IsParallel, "contextPlane", "direction", "Point.Project")); } var pt = contextPlane.Project(this, direction); pt.Context = contextPlane; pt.ReferencePoint = this; pt.Direction = direction; pt.Persist(); return(pt); }