Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp11
- {
- class Program
- {
- static void Main(string[] args)
- {
- Circle k1 = new Circle(0, 0, 7);
- Point p1 = new Point(0, 7);
- double d = Math.Sqrt((k1.X - p1.X) * (k1.X - p1.X) + (k1.Y - p1.Y) * (k1.Y - p1.Y));
- if (d < k1.R) Console.WriteLine("tochkata e v kruga");
- else if (d == k1.R) Console.WriteLine("tochkata e na okrujnostta");
- else Console.WriteLine("tochkata e izvun okrujnostta");
- }
- }
- class Point
- {
- private double x;
- public double X
- {
- get { return x; }
- set { x = value; }
- }
- private double y;
- public double Y
- {
- get { return y; }
- set { y = value; }
- }
- public Point(double x, double y)
- {
- this.x = x;
- this.y = y;
- }
- }
- class Circle : Point
- {
- private double r;
- public double R
- {
- get { return r; }
- set { r = value; }
- }
- public static double FormulaC(double r)
- {
- double c = 2 * r * Math.PI; return c;
- }
- public static double FormulaS(double r)
- {
- double s = r * r * Math.PI; return s;
- }
- public Circle(double x, double y, double r) : base(x, y)
- {
- this.r = r;
- }
- }
- }
Add Comment
Please, Sign In to add comment