Exemple #1
0
        public Length DistanceTo(Length2d other)
        {
            double dx       = X.Meters - other.X.Meters;
            double dy       = Y.Meters - other.Y.Meters;
            double distance = Math.Sqrt(dx * dx + dy * dy);

            return(Length.FromMeters(distance));
        }
Exemple #2
0
        public static Length GetDistance(Length2d a, Length2d b)
        {
            Vector2 d = (a - b).Meters;

            return(Length.FromMeters(Math.Sqrt(d.X * d.X + d.Y * d.Y)));
        }
Exemple #3
0
 public bool Equals(Length2d other)
 {
     return(Meters.Equals(other.Meters));
 }