Example #1
0
        public TLength DistanceFrom <TOtherLength>(PhysicalCoordinate <TOtherLength> otherPoint)
            where TOtherLength : NumericValue <Length>, new()
        {
            var distanceX = System.Math.Pow((X - otherPoint.X).Value, 2);
            var distanceY = System.Math.Pow((Y - otherPoint.Y).Value, 2);
            var distanceZ = System.Math.Pow((Z - otherPoint.Z).Value, 2);

            return(new TLength {
                Value = System.Math.Sqrt(distanceX + distanceY + distanceZ)
            });
        }
Example #2
0
 public PhysicalCoordinate <T> Convert <T>() where T : NumericValue <Length>, new()
 {
     return(PhysicalCoordinate <T> .Create(X.Convert <T>().Value, Y.Convert <T>().Value, Z.Convert <T>().Value));
 }