mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-25 04:15:45 -08:00
17 lines
326 B
C#
17 lines
326 B
C#
using System;
|
|
|
|
namespace Mugwump
|
|
{
|
|
internal class Distance
|
|
{
|
|
private readonly float _value;
|
|
|
|
public Distance(float deltaX, float deltaY)
|
|
{
|
|
_value = (float)Math.Sqrt(deltaX * deltaX + deltaY * deltaY);
|
|
}
|
|
|
|
public override string ToString() => $"{_value:0.0}";
|
|
}
|
|
}
|