Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace PointExercise
- {
- class TestPoint
- {
- public static void Main(string[] args)
- {
- Point p = new Point(43, 7);
- Point h = new Point(5, 5);
- Console.WriteLine("p=" + p);
- Console.WriteLine("h=" + h.ToString());
- double tempx = p.GetX();
- p.SetX(h.GetX());
- h.SetX(tempx);
- Console.WriteLine("p=" + p);
- Console.WriteLine("h=" + h);
- Console.WriteLine("distance=" + p.Distance(h));
- Console.WriteLine("distance=" + h.Distance(p));
- Point m = p.Middle(h); // m = h.Middle(p);
- Console.WriteLine("middle=" + m);
- // for testing only
- if (p.Distance(m) == m.Distance(h))
- {
- Console.WriteLine("OK");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment