Преобразование Double в BoolC#

Место общения программистов C#
Anonymous
Преобразование Double в Bool

Сообщение Anonymous »

Я пытаюсь определить, находится ли данная точка внутри круга, и вот мое решение на данный момент

Код: Выделить всё

using System;

//Write an expression that checks if given point (x, y) is inside a circle K({0, 0}, 2).

class Program
{
static void Main()
{
Console.Write("Enter x: ");
double x = double.Parse(Console.ReadLine());
Console.Write("Enter y: ");
double y = double.Parse(Console.ReadLine());
bool insideCircle = (double)Math.Sqrt((x * x) + (y + y) 

Подробнее здесь: [url]https://stackoverflow.com/questions/28028587/converting-double-to-bool[/url]

Вернуться в «C#»