Advertisement
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 ConsoleApp19
- {
- public class Tacka
- {
- private string imeTacke;
- private double x;
- private double y;
- public string ImeTacke { get => ImeTacke; set => ImeTacke = value; }
- public double X { get => x; set => x = value; }
- public double Y { get => y; set => y = value; }
- public double Udaljenost(Tacka T1,Tacka T2)
- {
- double ud = Math.Sqrt(((T1.x - T2.x) * (T1.x - T2.x)) + ((T1.y - T2.y) * (T1.y - T2.y)));
- return (ud);
- }
- public Tacka()
- {
- this.imeTacke = ImeTacke;
- }
- }
- public class Poligon
- {
- private string imePoligona;
- private static int brTemena;
- private Tacka[] temena = new Tacka[brTemena];
- private static int brPoligona;
- public string ImePoligona { get => ImePoligona; set => ImePoligona = value; }
- public static int BrTemena { get => BrTemena; set => BrTemena = value; }
- private Tacka[] Temena { get => Temena; set => Temena = value; }
- public static int BrPoligona { get => BrPoligona; set => BrPoligona = value; }
- public Poligon()
- {
- this.brTemena=BrTemena;
- }
- public Poligon kopiraj(Poligon P)
- ` {
- this.imePoligona=P.imePoligona;
- this.brTemena=P.brTemena;
- this.temena=P.temena;
- this.brPoligona=P.brPoligona;
- }
- public double Obim(int[] temena)
- {
- double obim=0;
- for(int i=1;i<temena.length;i++)
- {
- obim += Udaljenost(temena[i],temena[i-1]);
- }
- return obim;
- }
- public void DodajTacku(double x,double y,int[] temena)
- {
- temena.
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement