private static bool CollidesWithExistingPositions(UnitPoint3D position, List <Point3D> otherPositions, out UnitValue distanceToClosest) { var positionInPicoMeter = position.In(SIPrefix.Pico, Unit.Meter); var closestOther = otherPositions .Take(otherPositions.Count - 1) .MinimumItem(p => p.DistanceTo(positionInPicoMeter)); var distance = closestOther.DistanceTo(positionInPicoMeter); distanceToClosest = distance.To(SIPrefix.Pico, Unit.Meter); return(distance < 390); }
public static Point3D In(this UnitPoint3D unitPoint, IUnitDefinition targetUnit) { return(unitPoint.In(SIPrefix.None, targetUnit)); }