public ICollection <Vector2> ComputePositionsOnPlane(IEnumerable <Vector3D> positions) { if (positions == null) { throw new ArgumentNullException("positions"); } IList <Vector2> positionsOnPlane = new List <Vector2>(CollectionAlgorithms.EnumerableCount(positions)); foreach (Vector3 position in positions) { Vector3 intersectionPoint; if (IntersectionTests.TryRayPlane(Vector3.Zero, position.Normalize(), _normal, _d, out intersectionPoint)) { Vector3D v = intersectionPoint - _origin; positionsOnPlane.Add(new Vector2D(_xAxis.Dot(v), _yAxis.Dot(v))); } else { // Ray does not intersect plane } } return(positionsOnPlane); }
public ICollection <Geodetic2D> ToGeodetic2D(IEnumerable <Vector3> positions) { if (positions == null) { throw new ArgumentNullException("positions"); } IList <Geodetic2D> geodetics = new List <Geodetic2D>(CollectionAlgorithms.EnumerableCount(positions)); foreach (Vector3 position in positions) { geodetics.Add(ToGeodetic2D(position)); } return(geodetics); }