Konvertieren von Double in Bool [geschlossen]C#

Ein Treffpunkt für C#-Programmierer
Anonymous
 Konvertieren von Double in Bool [geschlossen]

Post by Anonymous »

Ich versuche herauszufinden, ob ein bestimmter Punkt innerhalb eines Kreises liegt, und hier ist meine Lösung für den Moment

Code: Select all

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)

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post