public float DistanceTo(SpacePoint <T> otherPoint, IDimensionSelector dimSelector) { var hasSelector = dimSelector != null; var sum = 0f; for (var d = 0; d < Dimensions.Length; ++d) { if (hasSelector && !dimSelector.IncludesDimension(d)) { continue; } var valOther = otherPoint.Dimensions[d].Position; var valCurrD = Dimensions[d].Position; var n = valCurrD - valOther; n = n * n; sum += n; } return((float)Math.Sqrt(sum)); }
public bool RemovePoint(SpacePoint <T> sp) { return(_points.Remove(sp)); }
public float DistanceTo(SpacePoint <T> otherPoint) { return(DistanceTo(otherPoint, null)); }
public bool AddPoint(SpacePoint <T> sp) { sp.Dimensions[Dimension.Index] = this; return(_points.Add(sp)); }